ALMaSS  1.0
The Animal, Landscape and Man Simulation System
Roe_Female Class Reference

#include <Roe_all.h>

Inheritance diagram for Roe_Female:
Roe_Adult_Base Roe_Base TAnimal TALMaSSObject

Public Member Functions

int SupplyIsPregnant ()
 
int SupplyYoung ()
 
void Init (void)
 
virtual void BeginStep (void)
 
virtual void Step (void)
 
virtual void EndStep (void)
 
virtual void On_IsDead (Roe_Base *Someone, int whos_dead, bool fawn)
 
bool On_InitCare (Roe_Fawn *Fawn)
 
void On_EndCare (Roe_Fawn *Fawn)
 
int SupplyGroupNo ()
 
void AddFawnToList (Roe_Fawn *fawn)
 
 Roe_Female (int x, int y, int size, int age, int group, Roe_Female *mum, Landscape *L, RoeDeer_Population_Manager *RPM)
 
virtual ~Roe_Female ()
 
- Public Member Functions inherited from Roe_Adult_Base
 Roe_Adult_Base (int x, int y, int size, int age, Landscape *L, RoeDeer_Population_Manager *RPM)
 
virtual ~Roe_Adult_Base ()
 
- Public Member Functions inherited from Roe_Base
unsigned IsAlive ()
 
int SupplyReserves ()
 
virtual void On_MumAbandon (Roe_Female *)
 
virtual void Send_IsDead ()
 
virtual void On_ChangeGroup (int)
 
RoeDeerInfo SupplyInfo ()
 
virtual int WhatState ()
 
 Roe_Base (int x, int y, Landscape *L, RoeDeer_Population_Manager *RPM)
 
virtual ~Roe_Base ()
 
- Public Member Functions inherited from TAnimal
unsigned SupplyFarmOwnerRef ()
 
AnimalPosition SupplyPosition ()
 
APoint SupplyPoint ()
 
int SupplyPolygonRef ()
 
int Supply_m_Location_x ()
 
int Supply_m_Location_y ()
 
virtual void KillThis ()
 
virtual void CopyMyself ()
 
void SetX (int a_x)
 
void SetY (int a_y)
 
 TAnimal (int x, int y, Landscape *L)
 
virtual void ReinitialiseObject (int x, int y, Landscape *L)
 Used to re-use an object - must be implemented in descendent classes. More...
 
virtual void Dying ()
 
void CheckManagement (void)
 
void CheckManagementXY (int x, int y)
 
virtual bool OnFarmEvent (FarmToDo)
 
- Public Member Functions inherited from TALMaSSObject
int GetCurrentStateNo ()
 Returns the current state number. More...
 
void SetCurrentStateNo (int a_num)
 Sets the current state number. More...
 
bool GetStepDone ()
 Returns the step done indicator flag. More...
 
void SetStepDone (bool a_bool)
 Sets the step done indicator flag. More...
 
virtual void ReinitialiseObject ()
 Used to re-use an object - must be implemented in descendent classes. More...
 
 TALMaSSObject ()
 The constructor for TALMaSSObject. More...
 
virtual ~TALMaSSObject ()
 The destructor for TALMaSSObject. More...
 
void OnArrayBoundsError ()
 Used for debugging only, tests basic object properties. More...
 

Public Attributes

Roe_Basem_MyYoung [20]
 
int m_MinInState [12]
 
int m_MyGroup
 
- Public Attributes inherited from Roe_Base
TRoeDeerStates CurrentRState
 
RoeDeer_Population_Managerm_OurPopulation
 
int m_Age
 
int m_Size
 
int m_RangeCentre_x
 
int m_RangeCentre_y
 
int m_Reserves
 
double m_HomeRange
 
int m_OldRange_x
 
int m_OldRange_y
 
int m_SearchRange
 
bool m_float
 
bool m_Disperse
 
bool m_HaveRange
 
Roe_FemaleMum
 
int m_ID
 
int m_FixlistNumber
 
bool m_Sex
 
bool m_IsDead
 
unsigned Alive
 

Protected Member Functions

int On_CanJoinGroup (Roe_Female *Female)
 
void On_UpdateGroup (int p_group_x, int p_group_y)
 
void On_ApproachOfDanger (int p_To_x, int p_To_y)
 
void Send_EndGroup ()
 
virtual void On_EndGroup ()
 
- Protected Member Functions inherited from Roe_Base
bool Running (int x, int y)
 
void Ignore (int p_To_x, int p_To_y)
 
int DistanceTo (int p_x, int p_y, int p_To_x, int p_To_y)
 
int DistanceToCC (int p_x, int p_y, int p_To_x, int p_To_y)
 
int DirectionTo (int p_x, int p_y, int p_To_x, int p_To_y)
 
int DirectionToCC (int p_x, int p_y, int p_To_x, int p_To_y)
 
int NextStep (int weight, int dir, int recurselevel)
 
int AssessHabitat (int polyref)
 
int AssessHabitat (int p_x, int p_y)
 
int LegalHabitat (int p_x, int p_y)
 
int LegalHabitatCC (int p_x, int p_y)
 
int Cover (int polyref)
 Calls the cover calculation for a given polyref. More...
 
int Cover (int p_x, int p_y)
 Calls the cover calculation for a given x,y location. More...
 
int CalcCover (TTypesOfLandscapeElement a_ele, int a_poly)
 The cover calculation for a given element type. More...
 
int CoverCC (int p_x, int p_y)
 
int NutriValue (int polyref)
 
int NutriValue (int p_x, int p_y)
 
int NutriValueCC (int p_x, int p_y)
 
int Feeding (bool p_Disperse)
 
void SeekCover (int threshold)
 
void SeekNutri (int p_threshold)
 
int ProbRoadCross (int p_x, int p_y, int p_width)
 
double CalculateRoadMortality (int p_x, int p_y, int p_width)
 
void WalkTo (int pos_x, int pos_y)
 
void WalkToCC (int pos_x, int pos_y)
 
- Protected Member Functions inherited from TAnimal
void CorrectWrapRound ()
 Corrects wrap around co-ordinate problems. More...
 

Protected Attributes

bool m_Care
 
int m_Gestationdays
 
bool m_Pregnant
 
Roe_Malem_My_Mate
 
int m_NoOfYoung
 
int m_DaysSinceParturition
 
bool m_WantGroup
 
bool m_NatalGroup
 
vector< int > * m_GroupList
 
int m_OptGroupSize
 
bool m_HaveGroup
 
bool m_GroupUpdated
 
int m_HeatCount
 
bool m_WasInHeat
 
- Protected Attributes inherited from Roe_Adult_Base
bool m_DestinationDecided
 
int m_NewState
 
int m_DispCount
 
int m_float_x
 
int m_float_y
 
- Protected Attributes inherited from Roe_Base
int timestep
 
int m_Cross_x
 
int m_Cross_y
 
double m_EnergyGained
 
int m_RecovCount
 
int m_RumiCount
 
int m_FeedCount
 
int m_LengthFeedPeriod
 
int m_LengthRuminate
 
int m_LastState
 
int m_danger_x
 
int m_danger_y
 
int m_distrc
 
int m_weightedstep
 
int SimW
 
int SimH
 
- Protected Attributes inherited from TAnimal
int m_Location_x
 
int m_Location_y
 
Landscapem_OurLandscape
 
- Protected Attributes inherited from TALMaSSObject
int m_CurrentStateNo
 The basic state number for all objects - '-1' indicates death. More...
 
bool m_StepDone
 Indicates whether the iterative step code is done for this timestep. More...
 

Private Member Functions

int FOnMature (void)
 
int FDie (void)
 
int FDisperse (void)
 
int FEstablishRange (void)
 
int FOnNewDay (void)
 
int FUpdateGestation (void)
 
int FGiveBirth (void)
 
int FFormGroup (void)
 
int FInHeat (void)
 
int FFeed (void)
 
int FRun ()
 
int FRecover (void)
 
int FEvade ()
 
int FIgnore ()
 
int FRuminate (void)
 
int FCareForYoung (void)
 
int FMate (void)
 
int FUpdateEnergy (void)
 

Constructor & Destructor Documentation

◆ Roe_Female()

Roe_Female::Roe_Female ( int  x,
int  y,
int  size,
int  age,
int  group,
Roe_Female mum,
Landscape L,
RoeDeer_Population_Manager RPM 
)

Roe_Female::Roe_Female - constructor for female object. Sets all attributes and creates groups for 1st generation roes. It also removes a matured fawn from group and adds it as adult female. It also adds fawns to mother's offspring list. Calls CreateNewGroup(), AddToGroup().

1828  :Roe_Adult_Base (x,y,size,age,L,RPM)
1829 {
1830  //set pointers to NULL
1831  for (int i=0;i<20;i++)
1832  {
1833  m_MyYoung[i]= NULL;
1834  }
1835 
1836 
1837  m_My_Mate=NULL;
1838  Mum=mum; //NULL for 1st generation roes
1839  if(group==-1) //1st generation roe
1840  {
1841  //create a new group and add yourself to that group
1843  m_GroupUpdated=true; //Jan. 1st
1844  }
1845  else //2nd generation or more
1846  {
1847  m_MyGroup=group;
1848  m_GroupUpdated=false; //summer
1849  m_OurPopulation->AddToGroup(this,m_MyGroup); //matured fawn removes itself
1850  //from group and the new female is added again
1851  }
1852  //add yourself to mothers offspring list
1853  if(Mum!=NULL)
1854  {
1855  #ifdef JUJ__Debug3
1856  if(Mum->IsAlive()!=0x0DEADC0DE)
1857  {
1858  m_OurLandscape ->Warn("Roe_Female::Roe_Female(): Deadcode warning, Mum!","");
1859  exit( 1 );
1860  }
1861  #endif
1862  for(int i=0;i<21;i++)
1863  {
1864  if(Mum->m_MyYoung[i]==NULL)
1865  {
1866  Mum->m_MyYoung[i]=this;
1867  break;
1868  }
1869  }
1870  }
1871  m_HaveGroup=true;
1872  m_Age = age;
1873  m_Pregnant = false;
1874  m_Reserves = 30;
1875  m_Gestationdays=-1;
1876  m_Sex = false;
1877  m_HeatCount=0;
1878  m_WasInHeat=false;
1879  m_LastState=35; //Feed. Could be any safe state
1880  m_HaveRange = false;
1881  m_OptGroupSize = 1; //as long as roe doesn't have a range
1882  m_NoOfYoung = 0;
1883  m_Care=false;
1884  m_NatalGroup = true;
1885  m_IsDead=false;
1887  if (size==-1) //1st generation roe
1888  {
1889  int rand = random(2000);
1890  m_Size = 16000 + rand; //size is set for the first generation
1891 
1892  }
1893  else m_Size=size;
1894  for (int i=0;i<12;i++) m_MinInState[i] = 0;
1895 
1896 }
int random(int a_range)
Definition: ALMaSS_CmdLine.cpp:142
void Warn(std::string a_msg1, std::string a_msg2)
Definition: landscape.h:1579
Roe_Adult_Base(int x, int y, int size, int age, Landscape *L, RoeDeer_Population_Manager *RPM)
Definition: Roe_adult.cpp:40
RoeDeer_Population_Manager * m_OurPopulation
Definition: Roe_all.h:104
bool m_Sex
Definition: Roe_all.h:120
bool m_IsDead
Definition: Roe_all.h:121
int m_Size
Definition: Roe_all.h:106
Roe_Female * Mum
Definition: Roe_all.h:117
bool m_HaveRange
Definition: Roe_all.h:116
int m_LastState
Definition: Roe_all.h:138
int m_Reserves
Definition: Roe_all.h:109
int m_Age
Definition: Roe_all.h:105
unsigned IsAlive()
Definition: Roe_all.h:123
int m_NoOfYoung
Definition: Roe_all.h:344
int m_OptGroupSize
Definition: Roe_all.h:350
bool m_HaveGroup
Definition: Roe_all.h:351
bool m_GroupUpdated
Definition: Roe_all.h:352
Roe_Base * m_MyYoung[20]
Definition: Roe_all.h:311
int m_DaysSinceParturition
Definition: Roe_all.h:345
bool m_Care
Definition: Roe_all.h:340
bool m_WasInHeat
Definition: Roe_all.h:354
bool m_NatalGroup
Definition: Roe_all.h:347
int m_HeatCount
Definition: Roe_all.h:353
Roe_Male * m_My_Mate
Definition: Roe_all.h:343
int m_MinInState[12]
Definition: Roe_all.h:312
int m_Gestationdays
Definition: Roe_all.h:341
int m_MyGroup
Definition: Roe_all.h:315
bool m_Pregnant
Definition: Roe_all.h:342
int CreateNewGroup(Roe_Base *p_deer)
Definition: Roe_Population_Manager.cpp:1368
bool AddToGroup(Roe_Base *p_deer, int TheGroup)
Definition: Roe_Population_Manager.cpp:1397
Landscape * m_OurLandscape
Definition: PopulationManager.h:229

References RoeDeer_Population_Manager::AddToGroup(), RoeDeer_Population_Manager::CreateNewGroup(), Roe_Base::IsAlive(), Roe_Base::m_Age, m_Care, m_DaysSinceParturition, m_Gestationdays, m_GroupUpdated, m_HaveGroup, Roe_Base::m_HaveRange, m_HeatCount, Roe_Base::m_IsDead, Roe_Base::m_LastState, m_MinInState, m_My_Mate, m_MyGroup, m_MyYoung, m_NatalGroup, m_NoOfYoung, m_OptGroupSize, TAnimal::m_OurLandscape, Roe_Base::m_OurPopulation, m_Pregnant, Roe_Base::m_Reserves, Roe_Base::m_Sex, Roe_Base::m_Size, m_WasInHeat, Roe_Base::Mum, random(), and Landscape::Warn().

◆ ~Roe_Female()

Roe_Female::~Roe_Female ( )
virtual
1899 {
1900  //remove pointers to fawns
1901  for(int i=0;i<20;i++)
1902  {
1903  if(m_MyYoung!=NULL)
1904  {
1905  m_MyYoung[i]=NULL;
1906  }
1907  }
1908  //remove yourself from group list
1909  if(!m_float)
1910  {
1912  m_MyGroup=-1;
1913  }
1914 }
bool m_float
Definition: Roe_all.h:114
bool RemoveFromGroup(Roe_Base *p_deer, int TheGroup)
Definition: Roe_Population_Manager.cpp:1430

References Roe_Base::m_float, m_MyGroup, m_MyYoung, Roe_Base::m_OurPopulation, and RoeDeer_Population_Manager::RemoveFromGroup().

Member Function Documentation

◆ AddFawnToList()

void Roe_Female::AddFawnToList ( Roe_Fawn fawn)

Roe_Female::AddFawnToList - adds fawns to offfspring list of female object. Calls AddToGroup().

1369 {
1370  //add to the end of offspring list
1371  for(int i=0;i<20;i++)
1372  {
1373  if(m_MyYoung[i]==NULL) //empty space
1374  {
1375  m_MyYoung[i]=fawn;
1376  break;
1377  }
1378  }
1379  //group list
1380 
1381  if(m_MyGroup!=-1)
1382  {
1384  }
1385 }

References RoeDeer_Population_Manager::AddToGroup(), m_MyGroup, m_MyYoung, and Roe_Base::m_OurPopulation.

Referenced by RoeDeer_Population_Manager::CreateObjects().

◆ BeginStep()

void Roe_Female::BeginStep ( void  )
virtual

Roe_Female::BeginStep - checks if female object is dead

Reimplemented from Roe_Adult_Base.

1393 {
1394  #ifdef JUJ__Debug3
1395  if(IsAlive()!=0x0DEADC0DE)
1396  {
1397  m_OurLandscape ->Warn("Roe_Female::BeginStep(): Deadcode warning","");
1398  exit( 1 );
1399  }
1400  #endif
1401 
1402 }

References Roe_Base::IsAlive(), TAnimal::m_OurLandscape, and Landscape::Warn().

◆ EndStep()

void Roe_Female::EndStep ( void  )
virtual

Roe_Female::EndStep - checks if female object is dead and adds to number of timesteps. If 1 whole day has passed, current state is set to FOnNewDay

Reimplemented from Roe_Adult_Base.

1802 {
1803  #ifdef JUJ__Debug3
1804  if(IsAlive()!=0x0DEADC0DE)
1805  {
1806  m_OurLandscape ->Warn("Roe_Female::EndStep(): Deadcode warning!","");
1807  exit( 1 );
1808  }
1809  #endif
1810  if (CurrentRState==rds_FDeathState) return;
1811 
1812  timestep++;
1813  if (m_OurPopulation->StepCounter%144==0) //1 day has passed
1814  {
1815  m_weightedstep=0;
1817  }
1818 }
@ rds_FOnNewDay
Definition: Roe_all.h:58
@ rds_FDeathState
Definition: Roe_all.h:90
int timestep
Definition: Roe_all.h:128
int m_weightedstep
Definition: Roe_all.h:143
TRoeDeerStates CurrentRState
Definition: Roe_all.h:103
long StepCounter
Definition: Roe_all.h:505

References Roe_Base::CurrentRState, Roe_Base::IsAlive(), TAnimal::m_OurLandscape, Roe_Base::m_OurPopulation, Roe_Base::m_weightedstep, rds_FDeathState, rds_FOnNewDay, RoeDeer_Population_Manager::StepCounter, Roe_Base::timestep, and Landscape::Warn().

◆ FCareForYoung()

int Roe_Female::FCareForYoung ( void  )
private

Roe_Female::FCareForYoung - sets female object to be in care for young state. Care periods are initiated by message from fawn to mother. Fawn keeps counter of minuts care (=suckling) per hour. If counter drops below min value fawn initiates extra care period. If care is done returns to feeding.

648 {
649  #ifdef JUJ__Debug3
650  if(IsAlive()!=0x0DEADC0DE)
651  {
652  m_OurLandscape ->Warn("Roe_Female::FCareForYoung(): Deadcode warning","");
653  exit( 1 );
654  }
655  #endif
656  //Care periods are initiated by message from fawn to mother. Fawn
657  //keeps counter of minuts care (=suckling) per hour. If counter drops below
658  //min value fawn initiates extra care period.
659  m_MinInState[3]+=1; //add 1 to time spend in this state
660  if (m_Care==true) return 18; //stay here
661  else
662  {
663  m_Care=false;
664  return 35; //feed
665  }
666 }

References Roe_Base::IsAlive(), m_Care, m_MinInState, TAnimal::m_OurLandscape, and Landscape::Warn().

Referenced by Step().

◆ FDie()

int Roe_Female::FDie ( void  )
private

Roe_Female::FDie - function for managing death of a female object. The female object sends message to offspring list and removes herself from group list. If attended by male when dying, she sends message to this male as well. The fixlist of the female object is emptied and the female furthermore adds itself to list of dead animals. Function returns dead state. Calls functions RemoveFixList()and On_IsDead().

978 {
979  #ifdef JUJ__Debug3
980  if(IsAlive()!=0x0DEADC0DE)
981  {
982  m_OurLandscape ->Warn("Roe_Female::FDie(): Deadcode warning","");
983  exit( 1 );
984  }
985  #endif
986  //When female dies she sends message to offspring list and removes
987  //herself from group list
988  //If attended by male when dying, she sends message to this male as well
989  //add yourself to list of dead animals
990  for(int i=0;i<2000;i++)
991  {
992  if(m_OurPopulation->DeadList[i][0] == 0) //empty entrance
993  {
994  m_OurPopulation->DeadList[i][0] = 2; //'1' for male, '2' for female
995  m_OurPopulation->DeadList[i][1] = m_Age; //age in days
996  break;
997  }
998  }
999  //empty the fixlist of this animal
1001 
1002  //tell mum
1003  if(Mum!=NULL)
1004  {
1005  #ifdef JUJ__Debug3
1006  if(Mum->IsAlive()!=0x0DEADC0DE)
1007  {
1008  m_OurLandscape ->Warn("Roe_Female::FDie(): Deadcode warning, Mum!","");
1009  exit( 1 );
1010  }
1011  #endif
1012  Mum->On_IsDead(this,3,false); //'3' indicates offspring
1013  Mum=NULL;
1014  }
1015  //tell offspring
1016  for (int i=0; i<20; i++)
1017  {
1018  if (m_MyYoung[i]!=NULL)
1019  {
1020  m_MyYoung[i]->On_IsDead(this,0,false); //'0' indicates Mum
1021  }
1022  }
1023  // Is there a male attending, if so send him a message
1024  if(m_My_Mate!=NULL)
1025  {
1026  #ifdef JUJ__Debug3
1027  if(m_My_Mate->IsAlive()!=0x0DEADC0DE)
1028  {
1029  m_OurLandscape ->Warn("Roe_Female::FDie(): Deadcode warning, m_My_Mate!","");
1030  exit( 1 );
1031  }
1032  #endif
1033  m_My_Mate->On_IsDead(this,2,false); //'2' indicates mate
1034  m_My_Mate=NULL;
1035  }
1036 
1037 
1038  m_CurrentStateNo=-1;
1039  return 44;
1040 
1041 }
int m_FixlistNumber
Definition: Roe_all.h:119
virtual void On_IsDead(Roe_Base *, int, bool)
Definition: Roe_all.h:217
virtual void On_IsDead(Roe_Base *Someone, int whos_dead, bool fawn)
Definition: Roe_female.cpp:1925
virtual void On_IsDead(Roe_Base *Someone, int whos_dead, bool fawn)
Definition: Roe_male.cpp:1504
void RemoveFixList(int listno)
Definition: Roe_Population_Manager.cpp:1346
int DeadList[2000][2]
Definition: Roe_all.h:504
int m_CurrentStateNo
The basic state number for all objects - '-1' indicates death.
Definition: PopulationManager.h:116

References RoeDeer_Population_Manager::DeadList, Roe_Base::IsAlive(), Roe_Base::m_Age, TALMaSSObject::m_CurrentStateNo, Roe_Base::m_FixlistNumber, m_My_Mate, m_MyYoung, TAnimal::m_OurLandscape, Roe_Base::m_OurPopulation, Roe_Base::Mum, Roe_Base::On_IsDead(), On_IsDead(), Roe_Male::On_IsDead(), RoeDeer_Population_Manager::RemoveFixList(), and Landscape::Warn().

Referenced by Step().

◆ FDisperse()

int Roe_Female::FDisperse ( void  )
private

Roe_Female::MDisperse - models dispersal state of female objects. Sets state to dispersal. It then keeps track of amount of time in the dispersal state and calculate probability of switching to feeding, keep dispersing, or dying if spending too long in dispersal state.Calls functions DirectionTo() and NextStep().

300 {
301  #ifdef JUJ__Debug3
302  if(IsAlive()!=0x0DEADC0DE)
303  {
304  m_OurLandscape ->Warn("Roe_Female::FDisperse(): Deadcode warning","");
305  exit( 1 );
306  }
307  #endif
308  m_DispCount++;
309  m_MinInState[0]+=1; //add 1 to time spend in this state
310  m_HaveRange=false; //a dispersing animal cannot be a rangeholder per def.
311  m_Disperse=true; //indicates that dispersal has started
312  //allow roe the opportunity to return to this state after disturbance
313  m_LastState=10;
314  if(m_DispCount==1) //first timestep in disperse
315  {
316  //store range centre coordinates while dispersing
319  }
320 
321  m_RangeCentre_x=m_Location_x; //these are drifting depending on roes position
323  //int dist=DistanceTo(m_Location_x,m_Location_y,m_OldRange_x,m_OldRange_y);
325  int rand=0;
326 
327  if(m_DispCount>70)
328  {
329  for(int i=0;i<3;i++)
330  {
331  if( NextStep(0,0,0) == -1) return 41;
332  }
333  }
334  else
335  {
336  for(int i=0;i<3;i++)
337  {
338  if( NextStep(1,((dir+4) & 0x07),0) == -1) return 41;
339  }
340  }
341 
342  switch (m_DispCount)
343  {
344  case 40:
345  rand=40;
346  break;
347  case 50:
348  rand=60;
349  break;
350  case 60:
351  rand=80;
352  break;
353  default:
354  if(m_DispCount>=70) rand=90;
355  break;
356  }
357 
358  if (rand>random(100)) //go to feed
359  {
360  return 35;
361  }
362  else return 10; //stay in disperse
363 }
int m_DispCount
Definition: Roe_all.h:239
int DirectionTo(int p_x, int p_y, int p_To_x, int p_To_y)
Definition: Roe_base.cpp:802
int m_RangeCentre_y
Definition: Roe_all.h:108
int m_OldRange_y
Definition: Roe_all.h:112
int m_OldRange_x
Definition: Roe_all.h:111
bool m_Disperse
Definition: Roe_all.h:115
int m_RangeCentre_x
Definition: Roe_all.h:107
int NextStep(int weight, int dir, int recurselevel)
Definition: Roe_base.cpp:1242
int m_Location_y
Definition: PopulationManager.h:228
int m_Location_x
Definition: PopulationManager.h:225

References Roe_Base::DirectionTo(), Roe_Base::IsAlive(), Roe_Adult_Base::m_DispCount, Roe_Base::m_Disperse, Roe_Base::m_HaveRange, Roe_Base::m_LastState, TAnimal::m_Location_x, TAnimal::m_Location_y, m_MinInState, Roe_Base::m_OldRange_x, Roe_Base::m_OldRange_y, TAnimal::m_OurLandscape, Roe_Base::m_RangeCentre_x, Roe_Base::m_RangeCentre_y, Roe_Base::NextStep(), random(), and Landscape::Warn().

Referenced by Step().

◆ FEstablishRange()

int Roe_Female::FEstablishRange ( void  )
private

Roe_Female::FEstablishRange - sets up range for female object. Sets object to not be a disperser or to have completed dispersal. Checks if object has a group and if not, assign it to a group. Makes sure that range centre is not too close to road or houses and sets a range center. When new range is set, calculate optimal group size in range based on % forest Always returns state feed. Calls functions CreateNewGroup(), SupplyElementType(), DistanceTo(), PercentForest().

73 {
74  #ifdef JUJ__Debug3
75  if(IsAlive()!=0x0DEADC0DE)
76  {
77  m_OurLandscape ->Warn("Roe_Female::FEstablishRange(): Deadcode warning","");
78  exit( 1 );
79  }
80  #endif
81 
82  m_MinInState[11]+=1; //add 1 to time spend in this state
83  m_HaveRange=true;
84  m_Disperse=false; //either not disperser or dispersal is completed
85  m_float=false;
86  //this animal is now established, so check if it has a group, else give it one
87  if(m_MyGroup == -1)
88  {
90  }
91  //make sure that range centre is not too close to road or houses
92  int t[8];
94  int dir=random(8); //start looking in any direction
95  int nogood[8]= {0};
96  bool move=false;
97  int Dist[8]={0};
98  int x=m_Location_x;
99  int y=m_Location_y;
100 
101  if((x <= 200)||(x >= SimW-200)||(y <= 200)||(y >= SimH-200)) //next step could take you out
102  {
103  //need to correct coordinates
104  x=m_Location_y+SimW;
105  y=m_Location_y+SimH;
106  for (int i=200; i>=0; i-=2) //every 2 meter closing in
107  {
108  t[0]=dir;
109  t[0]=t[0] & 7;
110  t[1]=dir+1;
111  t[1]=t[1] & 7;
112  t[2]=dir-1;
113  t[2]=(t[2]+8) & 7;
114  t[3]=dir+2;
115  t[3]=(t[3]+8) & 7;
116  t[4]=dir-2;
117  t[4]=(t[4]+8) & 7;
118  t[5]=dir+3;
119  t[5]=(t[5]+8) & 7;
120  t[6]=dir-3;
121  t[6]=(t[6]+8) & 7;
122  t[7]=dir+4;
123  t[7]=(t[7]+8) & 7;
124 
125  q[0]=m_OurLandscape->
126  SupplyElementTypeCC( x+(Vector_x[t[0]]*i), y+(Vector_y[t[0]]*i));
127  q[1]=m_OurLandscape->
128  SupplyElementTypeCC( x+(Vector_x[t[1]]*i), y+(Vector_y[t[1]]*i));
129  q[2]=m_OurLandscape->
130  SupplyElementTypeCC( x+(Vector_x[t[2]]*i), y+(Vector_y[t[2]]*i));
131  q[3]=m_OurLandscape->
132  SupplyElementTypeCC( x+(Vector_x[t[3]]*i), y+(Vector_y[t[3]]*i));
133  q[4]=m_OurLandscape->
134  SupplyElementTypeCC( x+(Vector_x[t[4]]*i), y+(Vector_y[t[4]]*i));
135  q[5]=m_OurLandscape->
136  SupplyElementTypeCC( x+(Vector_x[t[5]]*i), y+(Vector_y[t[5]]*i));
137  q[6]=m_OurLandscape->
138  SupplyElementTypeCC( x+(Vector_x[t[6]]*i), y+(Vector_y[t[6]]*i));
139  q[7]=m_OurLandscape->
140  SupplyElementTypeCC( x+(Vector_x[t[7]]*i), y+(Vector_y[t[7]]*i));
141 
142  for(int j=0; j<8;j++)
143  {
144  if ((q[j]>tole_Track)&&(q[j]<tole_ActivePit) ||
145  (q[j]==tole_Railway) ||
146  (q[j]==tole_Garden))
147  {
148  //too close in this direction
149  nogood[j]=1;
150  move=true;
152  x+(Vector_x[t[j]]*i),
153  y+(Vector_y[t[j]]*i));
154  }
155  }
156  }
157  if (move==true) //need to adjust range centre
158  {
159  int thisway=0;
160  int closest=0;
161  int furthest=0;
162  for(int i=0;i<8;i++)
163  {
164  if(Dist[i] < closest) closest=Dist[i];
165  if (Dist[i]> furthest)
166  {
167  furthest=Dist[i];
168  thisway=i;
169  }
170  }
171 
172  if (closest<furthest/2) //move range centre halfway along furthest
173  {
174  for (int i=furthest/2;i<200;i++)
175  {
176  int xi = x + Vector_x[t[thisway]]*i;
177  int yi = y + Vector_y[t[thisway]]*i;
178  m_OurLandscape->CorrectCoords( xi, yi );
179  int quali=LegalHabitatCC( xi, yi);
180  if (quali>0)
181  {
183  CorrectWidth( m_Location_x+(Vector_x[t[thisway]]*i) );
185  CorrectHeight( m_Location_y+(Vector_y[t[thisway]]*i) );
186  }
187  }
188  }
189  }
190  //nothing gained by moving or no reason to move, so stay
193  }
194  else //no need to correct coordinates
195  {
196  int x=m_Location_x;
197  int y=m_Location_y;
198  for (int i=200; i>=0; i-=2) //every 2 meter closing in
199  {
200  t[0]=dir;
201  t[0]=t[0] & 7;
202  t[1]=dir+1;
203  t[1]=t[1] & 7;
204  t[2]=dir-1;
205  t[2]=(t[2]+8) & 7;
206  t[3]=dir+2;
207  t[3]=(t[3]+8) & 7;
208  t[4]=dir-2;
209  t[4]=(t[4]+8) & 7;
210  t[5]=dir+3;
211  t[5]=(t[5]+8) & 7;
212  t[6]=dir-3;
213  t[6]=(t[6]+8) & 7;
214  t[7]=dir+4;
215  t[7]=(t[7]+8) & 7;
216 
217  q[0]=m_OurLandscape->SupplyElementType((x+(Vector_x[t[0]]*i)),
218  (y+(Vector_y[t[0]]*i)));
219  q[1]=m_OurLandscape->SupplyElementType((x+(Vector_x[t[1]]*i)),
220  (y+(Vector_y[t[1]]*i)));
221  q[2]=m_OurLandscape->SupplyElementType((x+(Vector_x[t[2]]*i)),
222  (y+(Vector_y[t[2]]*i)));
223  q[3]=m_OurLandscape->SupplyElementType((x+(Vector_x[t[3]]*i)),
224  (y+(Vector_y[t[3]]*i)));
225  q[4]=m_OurLandscape->SupplyElementType((x+(Vector_x[t[4]]*i)),
226  (y+(Vector_y[t[4]]*i)));
227  q[5]=m_OurLandscape->SupplyElementType((x+(Vector_x[t[5]]*i)),
228  (y+(Vector_y[t[5]]*i)));
229  q[6]=m_OurLandscape->SupplyElementType((x+(Vector_x[t[6]]*i)),
230  (y+(Vector_y[t[6]]*i)));
231  q[7]=m_OurLandscape->SupplyElementType((x+(Vector_x[t[7]]*i)),
232  (y+(Vector_y[t[7]]*i)));
233  for(int j=0; j<8;j++)
234  {
235  if ((q[j]>tole_Track)&&(q[j]<tole_ActivePit)||(q[j]==tole_Railway)
236  ||(q[j]==tole_Garden))
237  {
238  //too close in this direction
239  nogood[j]=1;
240  move=true;
241  Dist[j]=DistanceTo(m_Location_x,m_Location_y,(x+(Vector_x[t[j]]*i)),
242  (y+(Vector_y[t[j]]*i)));
243  }
244  }
245  }
246  if (move==true) //need to adjust range centre
247  {
248  int thisway=0;
249  int closest=0;
250  int furthest=0;
251  for(int i=0;i<8;i++)
252  {
253  if(Dist[i] < closest) closest=Dist[i];
254  if (Dist[i]> furthest)
255  {
256  furthest=Dist[i];
257  thisway=i;
258  }
259  }
260 
261  if (closest<furthest/2) //move range centre halfway along furthest
262  {
263  for (int i=furthest/2;i<200;i++)
264  {
265  int quali=LegalHabitat((x+(Vector_x[t[thisway]]*i)),
266  (y+(Vector_y[t[thisway]]*i)));
267  if (quali>0)
268  {
269  m_RangeCentre_x=m_Location_x+(Vector_x[t[thisway]]*i);
270  m_RangeCentre_y=m_Location_y+(Vector_y[t[thisway]]*i);
271  }
272  }
273  }
274  }
275  //nothing gained by moving or no reason to move, so stay
278  m_OldRange_x=m_Location_x; //OldRange used to store range while in group
280  }
281 
282  //new range is set, so calculate optimal group size in your range
283  //first step is to get % forest
285  if(forest<4) m_OptGroupSize=10; //max group size
286  else m_OptGroupSize= (int)(17.1*(pow(forest,-0.49))); //relation between % forest
287  //and observed group sizes.
288  m_DispCount=0;
289  return 35; //always to feed after this
290 }
const int Vector_x[8]
const int Vector_y[8]
void CorrectCoords(int &x, int &y)
Function to prevent wrap around errors with co-ordinates using x/y pair.
Definition: landscape.h:1535
TTypesOfLandscapeElement SupplyElementType(int a_polyref)
Definition: landscape.h:1110
int SimH
Definition: Roe_all.h:145
int SimW
Definition: Roe_all.h:144
int LegalHabitatCC(int p_x, int p_y)
Definition: Roe_all.h:172
int m_SearchRange
Definition: Roe_all.h:113
int LegalHabitat(int p_x, int p_y)
Definition: Roe_base.cpp:847
int DistanceTo(int p_x, int p_y, int p_To_x, int p_To_y)
Definition: Roe_base.cpp:784
int DistanceToCC(int p_x, int p_y, int p_To_x, int p_To_y)
Definition: Roe_all.h:150
double PercentForest(int p_x, int p_y, int p_range)
Definition: Roe_range_qual.cpp:121
TTypesOfLandscapeElement
Definition: tole_declaration.h:36
@ tole_Garden
Definition: tole_declaration.h:58
@ tole_Track
Definition: tole_declaration.h:59
@ tole_ActivePit
Definition: tole_declaration.h:63
@ tole_Railway
Definition: tole_declaration.h:39

References Landscape::CorrectCoords(), RoeDeer_Population_Manager::CreateNewGroup(), Roe_Base::DistanceTo(), Roe_Base::DistanceToCC(), Roe_Base::IsAlive(), Roe_Base::LegalHabitat(), Roe_Base::LegalHabitatCC(), Roe_Adult_Base::m_DispCount, Roe_Base::m_Disperse, Roe_Base::m_float, Roe_Base::m_HaveRange, TAnimal::m_Location_x, TAnimal::m_Location_y, m_MinInState, m_MyGroup, Roe_Base::m_OldRange_x, Roe_Base::m_OldRange_y, m_OptGroupSize, TAnimal::m_OurLandscape, Roe_Base::m_OurPopulation, Roe_Base::m_RangeCentre_x, Roe_Base::m_RangeCentre_y, Roe_Base::m_SearchRange, RoeDeer_Population_Manager::PercentForest(), random(), Roe_Base::SimH, Roe_Base::SimW, Landscape::SupplyElementType(), tole_ActivePit, tole_Garden, tole_Railway, tole_Track, Vector_x, Vector_y, and Landscape::Warn().

Referenced by Step().

◆ FEvade()

int Roe_Female::FEvade ( )
private

Roe_Female::FEvade - checks direction to threath and takes 50 steps in opposite direction. Returns to same state as before disturbance. Calls DirectionTo(), NextStep()

524 {
525  #ifdef JUJ__Debug3
526  if(IsAlive()!=0x0DEADC0DE)
527  {
528  m_OurLandscape ->Warn("Roe_Female::FEvade(): Deadcode warning","");
529  exit( 1 );
530  }
531  #endif
532  m_MinInState[7]+=1; //add 1 to time spend in this state
533  int weight=3;
534  //get direction to threat
536  //take 50 steps in opposite direction
537  NextStep(weight,((dir+4) & 0x07),0);
538  //return to same state as before disturbance
539  return m_LastState;
540 }
int m_danger_x
Definition: Roe_all.h:139
int m_danger_y
Definition: Roe_all.h:140

References Roe_Base::DirectionTo(), Roe_Base::IsAlive(), Roe_Base::m_danger_x, Roe_Base::m_danger_y, Roe_Base::m_LastState, TAnimal::m_Location_x, TAnimal::m_Location_y, m_MinInState, TAnimal::m_OurLandscape, Roe_Base::NextStep(), and Landscape::Warn().

Referenced by Step().

◆ FFeed()

int Roe_Female::FFeed ( void  )
private

Roe_Female::FFeed - Models feeding of female object, including energy budget and search for better feeding area. Also determines need to ruminate. In theory a roe deer can spend time in more than 1 type of habitat within 1 timestep. For the energy budget only the habitat type where roe deer is at the beginning of each time step is recorded. Need to keep counter of minutes in feed since the end of last ruminating period (m_FeedCount) to know when to return to ruminate. Returns values for dispersal, ruminate or keep feeding (or die). Calls function NutriValue()

375 {
376  #ifdef JUJ__Debug3
377  if(IsAlive()!=0x0DEADC0DE)
378  {
379  m_OurLandscape ->Warn("Roe_Female::FFeed(): Deadcode warning","");
380  exit( 1 );
381  }
382  #endif
383  //In theory a roe can spend time in more than 1 type of habitat within 1 timestep.
384  //For the energy budget only the habitat type where roe is at the beginning of
385  //each time step is recorded. m_AmFeeding is set to true on 2nd feeding step
386  //(i.e. whenever roe decides to stay in feed). Need to keep counter of minuts
387  //in feed since the end of last ruminating period (m_FeedCount) to know when to
388  //return to ruminate
389  m_MinInState[9]+=1; //add 1 to time spend in this state
390  m_FeedCount++; //add 1 to count for this feeding bout
391  //allow roe the opportunity to return to this state after disturbance
392  m_LastState=35; //Feed
393  //Find the nutritional value here
394  int nutri=NutriValue(m_Location_x,m_Location_y); //possible energy gain per minut
395  if(nutri<MinNutri) //not good enough for feeding
396  {
397  SeekNutri(MinNutri); //look for a better place first
399  }
400  else //can feed here
401  {
402  m_EnergyGained+=nutri; //add this to total count for today
404  }
405  //did roe die while taking feeding steps?
406  if (m_IsDead) //is dead
407  {
408  m_FeedCount=0;
409  return 41; //Die
410  }
411  else //still alive, so decide whereto next.
412  {
413  if (m_FeedCount>m_LengthFeedPeriod) //need to ruminate
414  {
415  //for how long do you need to ruminate?
416  int month= m_OurLandscape->SupplyMonth();
417  m_LengthRuminate=(int) (m_FeedCount*IntakeRate[month-1]*0.1);
418  m_FeedCount=0; //counter to zero
419  return 32; //Ruminate
420  }
421  else if (m_Disperse==true) //a disperser, go back to disperse with 30:70 chance
422  //"Cheap" solution. No basis for setting this value. Return to this later....
423  {
424  int rand=random(100);
425  if (rand<30)
426  {
427  m_FeedCount=0;
428  return 10; //Disperse
429  }
430  }
431  }
432  return 35;
433 }
const int MinNutri
Definition: Roe_constants.cpp:62
const float IntakeRate[12]
Definition: Roe_constants.cpp:56
int SupplyMonth(void)
Definition: landscape.h:1601
int m_LengthFeedPeriod
Definition: Roe_all.h:136
int NutriValue(int polyref)
int m_FeedCount
Definition: Roe_all.h:135
int Feeding(bool p_Disperse)
Definition: Roe_base.cpp:737
double m_EnergyGained
Definition: Roe_all.h:132
int m_LengthRuminate
Definition: Roe_all.h:137
void SeekNutri(int p_threshold)
Definition: Roe_base.cpp:197

References Roe_Base::Feeding(), IntakeRate, Roe_Base::IsAlive(), Roe_Base::m_Disperse, Roe_Base::m_EnergyGained, Roe_Base::m_FeedCount, Roe_Base::m_IsDead, Roe_Base::m_LastState, Roe_Base::m_LengthFeedPeriod, Roe_Base::m_LengthRuminate, TAnimal::m_Location_x, TAnimal::m_Location_y, m_MinInState, TAnimal::m_OurLandscape, MinNutri, Roe_Base::NutriValue(), random(), Roe_Base::SeekNutri(), Landscape::SupplyMonth(), and Landscape::Warn().

Referenced by Step().

◆ FFormGroup()

int Roe_Female::FFormGroup ( void  )
private

Roe_Female::FFormGroup - Function for formation of female group. All deer in groups of size less than optimum, will ask around for group sizes of other groups. If closer to optimum than their own, they can change groups. If this is the case a roe has to add itself to new group, remove itself from old group and message this years fawns about new group. The roe gets a list of females within a certatin range of the roe location then send message to all these females that they can join group. The roe then evaluate answers and decide whether to change group. A new group needs to be larger than old group but still <=optimal group size. Once in a group oldes female in group is found and the range centre of this female serves as group range center. Returns update energy. Calls Supply_GroupSize(), SupplyFemales(), On_CanJoinGroup(), SupplyGroupNo(), RemoveFromGroup(), AddToGroup(), SupplyInfo() On_ChangeGroup(), Supply_RoeGroup(), On_UpdateGroup()

1170 {
1171  #ifdef JUJ__Debug3
1172  if(IsAlive()!=0x0DEADC0DE)
1173  {
1174  m_OurLandscape ->Warn("Roe_Female::FFormGroup(): Deadcode warning","");
1175  exit( 1 );
1176  }
1177  #endif
1178 
1179  /*All deer in groups of size less than optimum, will ask around for groupsizes
1180  of other groups. If closer to optimum than their own, they can change groups*/
1181  m_WantGroup = false;
1182  size_t Group_Size = 1;
1183  if(m_MyGroup == -1) //was a floater
1184  {
1185  m_WantGroup=true;
1186  }
1187  else
1188  {
1189  Group_Size=m_OurPopulation->Supply_GroupSize(m_MyGroup); //my group size
1190  if (Group_Size<m_OptGroupSize) //always want to join another group if this is true
1191  {
1192  m_WantGroup=true;
1193  }
1194  else if((m_Disperse)&&(m_NatalGroup)) //disperser without a group of its own
1195  {
1196  m_WantGroup=true;
1197  }
1198  }
1199 
1200  if (m_WantGroup) //look for a better group
1201  {
1202  ListOfFemales* RFL;
1203  //first get list of female
1205  int result;
1206  int bestgroup=m_MyGroup;
1207 
1208  for (unsigned i=0; i<RFL->size(); i++)
1209  {
1210  #ifdef JUJ__Debug3
1211  if((*RFL)[i]->IsAlive()!=0x0DEADC0DE)
1212  {
1213  m_OurLandscape ->Warn("Roe_Female::FFormGroup(): Deadcode warning, (*RFL)[i]","");
1214  exit( 1 );
1215  }
1216  #endif
1217  if((*RFL)[i]!=this) //don't send to yourself
1218  {
1219  //Send message "CanJoinGroup" to all these females
1220  result=(*RFL)[i]->On_CanJoinGroup(this);
1221  //evaluate answers and decide whether to change group. new group needs
1222  //to be larger than old group but still <=optimal group size.
1223  if ((result>Group_Size)&&(result<=m_OptGroupSize))
1224  {
1225  bestgroup=(*RFL)[i]->SupplyGroupNo(); //better than mine
1226  break; //better group found
1227  }
1228  }
1229  }
1230  delete RFL;
1231  if (bestgroup!=m_MyGroup) //another group is better than mine
1232  {
1233  //remove yourself from your old group
1235  // Get the new group number
1236  m_MyGroup=bestgroup;
1237  //Add yourself to the new group
1239  //make sure that this years fawns know about new group
1240  if(m_NoOfYoung!=0)
1241  {
1242  for (int i=0;i<20;i++)
1243  {
1244  if(m_MyYoung[i]!=NULL)
1245  {
1246  #ifdef JUJ__Debug3
1247  if(m_MyYoung[i]->IsAlive()!=0x0DEADC0DE)
1248  {
1249  m_OurLandscape ->Warn("Roe_Female::FFormGroup():Deadcode warning, m_MyYoung[i]","");
1250  exit( 1 );
1251  }
1252  #endif
1253  RoeDeerInfo info=m_MyYoung[i]->SupplyInfo();
1254  if (info.m_Age<365)
1255  {
1257  }
1258  }
1259  }
1260  }
1261  }
1262  }
1263  if(m_GroupUpdated==false)
1264  { //Find group range centre and send message to group members "UpdateGroup"
1265  int oldest=0;
1266  unsigned x=0;
1267  unsigned y=0;
1268  //find oldest female in your group
1270  for (unsigned i=0; i<group->size(); i++)
1271  {
1272  #ifdef JUJ__Debug3
1273  if((*group)[i]->IsAlive()!=0x0DEADC0DE)
1274  {
1275  m_OurLandscape ->Warn("Roe_Female::FFormGroup():Deadcode warning, (*group)[i]!","");
1276  exit( 1 );
1277  }
1278  #endif
1279  RoeDeerInfo info=(*group)[i]->SupplyInfo(); //get info about each deer in group
1280  if(info.m_Age>oldest)
1281  {
1282  oldest=info.m_Age;
1283  x=info.m_Range_x; //group centre=that females rangecentre
1284  y=info.m_Range_y;
1285  }
1286  }
1287  for (unsigned i=0; i<group->size(); i++)
1288  { //send to yourself as well to update your own attributes
1289  (*group)[i]->On_UpdateGroup(x,y);
1290  }
1291  }
1292  m_WantGroup=false;
1293  return 4; //UpdateEnergy
1294 }
vector< Roe_Base * > ListOfDeer
Definition: Roe_all.h:41
vector< Roe_Female * > ListOfFemales
Definition: Roe_all.h:40
RoeDeerInfo SupplyInfo()
Definition: Roe_base.cpp:1668
virtual void On_ChangeGroup(int)
Definition: Roe_all.h:220
bool m_WantGroup
Definition: Roe_all.h:346
ListOfDeer * Supply_RoeGroup(int Group)
Definition: Roe_all.h:520
ListOfFemales * SupplyFemales(int p_x, int p_y, int SearchRange)
Definition: Roe_Population_Manager.cpp:1216
size_t Supply_GroupSize(int Group)
Definition: Roe_all.h:513
Part of the basic ALMaSS system (obselete)
Definition: PopulationManager.h:187
unsigned m_Range_y
Definition: PopulationManager.h:192
int m_Age
Definition: PopulationManager.h:190
unsigned m_Range_x
Definition: PopulationManager.h:191

References RoeDeer_Population_Manager::AddToGroup(), Roe_Base::IsAlive(), RoeDeerInfo::m_Age, Roe_Base::m_Disperse, m_GroupUpdated, TAnimal::m_Location_x, TAnimal::m_Location_y, m_MyGroup, m_MyYoung, m_NatalGroup, m_NoOfYoung, m_OptGroupSize, TAnimal::m_OurLandscape, Roe_Base::m_OurPopulation, RoeDeerInfo::m_Range_x, RoeDeerInfo::m_Range_y, Roe_Base::m_SearchRange, m_WantGroup, Roe_Base::On_ChangeGroup(), RoeDeer_Population_Manager::RemoveFromGroup(), RoeDeer_Population_Manager::Supply_GroupSize(), RoeDeer_Population_Manager::Supply_RoeGroup(), RoeDeer_Population_Manager::SupplyFemales(), Roe_Base::SupplyInfo(), and Landscape::Warn().

Referenced by Step().

◆ FGiveBirth()

int Roe_Female::FGiveBirth ( void  )
private

Roe_Female::FGiveBirth - Function for female object giving birth to fawns. Litter size is related to maternal weight, Littersize=0.15*W - 0.68, where 'W'=maternal weight in kg. After litter size has been calculated, the corresponding number of fawn objects are created. Fawns are randomly assinged sex (50:50), sizes of fawn are calculated (int)((pow(((float)m_Size*0.001),0.9)*0.166)*1000); //Oftedal 1985, mum is assigned and fawns are added to mother's offspring list and group list. Calls CreateObjects().

1307 {
1308  #ifdef JUJ__Debug3
1309  if(IsAlive()!=0x0DEADC0DE)
1310  {
1311  m_OurLandscape ->Warn("Roe_Female::FGiveBirth(): Deadcode warning","");
1312  exit( 1 );
1313  }
1314  #endif
1315 
1316  Deer_struct* fds;
1317  fds=new Deer_struct;
1318  bool sex;
1319  m_MinInState[2]+=1; //add 1 to time spend in this state
1320  //litter size is related to maternal weight (Hewison 1996)
1321  //Littersize=0.15*W - 0.68, where 'W'=maternal weight in kg. Multiply by
1322  //0.15/1000 since body weight is in grams.
1323  //To round to nearest int, add 0.5 and round down
1324  float young = (0.00015f*m_Size)-0.68f;
1325  m_NoOfYoung = (int) floor(young + 0.5);
1326 
1327  //for lene's output
1328  //m_OurPopulation->WriteReproFile("Reproduction.txt",m_ID, m_NoOfYoung);
1329 
1330  for(int i=0; i<m_NoOfYoung; i++)
1331  {
1332  int rand = random(100);
1333  if (rand<prop_femalefawns)
1334  {
1335  sex=false; //female
1336  }
1337  else
1338  {
1339  sex=true; //males
1340  }
1341  //call CreateObjects to create the right no. of fawns
1342  fds->Pop = m_OurPopulation;
1343  fds-> L = m_OurLandscape;
1344  fds->sex = sex;
1345  fds->x = m_Location_x;
1346  fds->y = m_Location_y;
1347  fds->mum = this;
1348  fds->size = (int)((pow(((float)m_Size*0.001),0.9)*0.166)*1000); //Oftedal 1985
1349  fds->group = m_MyGroup;
1350  //debug
1351 
1352  fds->ID = -1; //don't know yet
1353  m_OurPopulation->CreateObjects(0,this,NULL,fds,1);
1354  //fawns are added to offspring list and mothers group list
1355  }
1356  delete fds;
1357 
1358  m_Pregnant=false;
1360  m_Gestationdays=-1;
1361  return 18; //CareForYoung
1362 }
const int prop_femalefawns
Definition: Roe_constants.cpp:83
Definition: Roe_all.h:437
int x
Definition: Roe_all.h:439
RoeDeer_Population_Manager * Pop
Definition: Roe_all.h:443
int size
Definition: Roe_all.h:446
int ID
Definition: Roe_all.h:448
bool sex
Definition: Roe_all.h:441
int y
Definition: Roe_all.h:440
int group
Definition: Roe_all.h:445
Roe_Female * mum
Definition: Roe_all.h:444
void CreateObjects(int, TAnimal *pvo, void *null, Deer_struct *data, int number)
Definition: Roe_Population_Manager.cpp:1268

References RoeDeer_Population_Manager::CreateObjects(), Deer_struct::group, Deer_struct::ID, Roe_Base::IsAlive(), m_DaysSinceParturition, m_Gestationdays, TAnimal::m_Location_x, TAnimal::m_Location_y, m_MinInState, m_MyGroup, m_NoOfYoung, TAnimal::m_OurLandscape, Roe_Base::m_OurPopulation, m_Pregnant, Roe_Base::m_Size, Deer_struct::mum, Deer_struct::Pop, prop_femalefawns, random(), Deer_struct::sex, Deer_struct::size, Landscape::Warn(), Deer_struct::x, and Deer_struct::y.

Referenced by Step().

◆ FIgnore()

int Roe_Female::FIgnore ( )
private

Roe_Female::FIgnore - Ignore threath and 1 to time spend in this state. Return to same state as before disturbance

547 {
548  #ifdef JUJ__Debug3
549  if(IsAlive()!=0x0DEADC0DE)
550  {
551  m_OurLandscape ->Warn("Roe_Female::FIgnore(): Deadcode warning","");
552  exit( 1 );
553  }
554  #endif
555  m_MinInState[6]+=1; //add 1 to time spend in this state
556  //return to same state as before disturbance
557  return m_LastState;
558 }

References Roe_Base::IsAlive(), Roe_Base::m_LastState, m_MinInState, TAnimal::m_OurLandscape, and Landscape::Warn().

Referenced by Step().

◆ FInHeat()

int Roe_Female::FInHeat ( void  )
private

Roe_Female::FInHeat - sets female object to be in heat. Female object Start new day in this state and stays here until it has found at mate or heat is over. Female heat lasts for 3 days. The female will get a list of all males in area and send them a message. If no males are around, the female will search a larger area. If find a male that will mate and is close enough to attend, male list will be deleted and this particular male is set as the female's mate. Calls SupplyMales(), On_InHeat().

677 {
678  #ifdef JUJ__Debug3
679  if(IsAlive()!=0x0DEADC0DE)
680  {
681  m_OurLandscape ->Warn("Roe_Female::FInHeat(): Deadcode warning","");
682  exit( 1 );
683  }
684  #endif
685  //start new day in this state and stay here until m_Have_Mate = true or heat
686  //is over
687  m_MinInState[1]+=1; //add 1 to time spend in this state
688  //allow roe the opportunity to return to this state after disturbance
689  m_LastState=16; //InHeat
690  bool CanMate=false;
691  ListOfMales* males;
692  m_HeatCount ++; //female heat lasts for 3 days
693  if(m_HeatCount%3==0) //every 30 minutes
694  {
695  //get a list of all Males in area and send them a message
697  2*m_SearchRange);
698  if(males->size() == 0) //no one around, so search a larger area
699  {
700  delete males;
702  4*m_SearchRange);
703  }
704  for (unsigned i=0; i<males->size(); i++)
705  {
706  #ifdef JUJ__Debug1
707  if((*males)[i]==NULL)
708  {
709  m_OurLandscape ->Warn("Roe_Female::FInHeat(): (*males)[i]==NULL!","");
710  exit( 1 );
711  }
712  #endif
713  #ifdef JUJ__Debug3
714  if((*males)[i]->IsAlive()!=0x0DEADC0DE)
715  {
716  m_OurLandscape ->Warn("Roe_Female::FEstablishRange():Deadcode warning, (*males)[i]!","");
717  exit( 1 );
718  }
719  #endif
720 
721  //send them message
722  CanMate = (*males)[i]->On_InHeat(this, m_Location_x,m_Location_y);
723  if (CanMate==true) //this male will mate and is close enough to attend
724  {
725  m_My_Mate=(*males)[i];
726  delete males;
727  return 35; //return to normal activity
728  }
729  }
730  delete males;
731  }
732  if (m_HeatCount==432) //have to go back to normal activity after 3 days
733  {
734  m_HeatCount=0;
735  return 35;
736  }
737  return 16; //else stay in heat
738 }
vector< Roe_Male * > ListOfMales
Definition: Roe_all.h:39
ListOfMales * SupplyMales(int p_x, int p_y, int SearchRange)
Definition: Roe_Population_Manager.cpp:1154

References Roe_Base::IsAlive(), m_HeatCount, Roe_Base::m_LastState, TAnimal::m_Location_x, TAnimal::m_Location_y, m_MinInState, m_My_Mate, TAnimal::m_OurLandscape, Roe_Base::m_OurPopulation, Roe_Base::m_SearchRange, RoeDeer_Population_Manager::SupplyMales(), and Landscape::Warn().

Referenced by Step().

◆ FMate()

int Roe_Female::FMate ( void  )
private

Roe_Female::FMate - sets female object to be pregnant and sets gestation days to be zero. Also, function stops female from being attended by male. Female returns to same state as before OnNewDay.

1139 {
1140  #ifdef JUJ__Debug3
1141  if(IsAlive()!=0x0DEADC0DE)
1142  {
1143  m_OurLandscape ->Warn("Roe_Female::FMate(): Deadcode warning","");
1144  exit( 1 );
1145  }
1146  #endif
1147  m_MinInState[10]+=1; //add 1 to time spend in this state
1148  m_Gestationdays=0;
1149  m_Pregnant=true;
1150  m_My_Mate=NULL; //not attended anymore
1151  //return to same state as before OnNewDay
1152  return m_LastState;
1153 }

References Roe_Base::IsAlive(), m_Gestationdays, Roe_Base::m_LastState, m_MinInState, m_My_Mate, TAnimal::m_OurLandscape, m_Pregnant, and Landscape::Warn().

Referenced by Step().

◆ FOnMature()

int Roe_Female::FOnMature ( void  )
private

Roe_Female::FOnMature - Checks if area is good enough to establish range. The function ScanGrid() adds the quality values stored in m_grid starting with a minimum area of 400 x 400 m. If not sufficient it extends outwards in all directions until max range is reached (800 x 800 m). It also checks if amount of other females nearby is below a female density threshold. It returns the size of the resulting area if good enough and 0 if not good enough. Calls ScanGrid(), SupplyFemaleRC().

33 {
34  #ifdef JUJ__Debug3
35  if(IsAlive()!=0x0DEADC0DE)
36  {
37  m_OurLandscape ->Warn("Roe_Female::FOnMature(): Deadcode warning","");
38  exit( 1 );
39  }
40  #endif
41  //Check whether this area is good enough. The function ScanGrid()
42  //adds the quality values stored in m_grid starting with a minimum area of
43  //400 x 400 m. If not sufficient it extends outwards in all directions
44  //until max range is reached (800 x 800 m). It returns the size of the
45  //resulting area if good enough and 0 if not good enough
46 
48  if (range > 0) //good enough
49  {
50  //how many other females already in area?
51  ListOfFemales* females= m_OurPopulation->
52  SupplyFemaleRC(m_Location_x,m_Location_y,range);
53  if(females->size() < FemaleDensityThreshold) //OK
54  {
55  m_SearchRange = range;
56  delete females;
57  return 7; // establish range
58  }
59  delete females;
60  }
61  return 10; //no options in this area, so disperse
62 }
const unsigned FemaleDensityThreshold
Definition: Roe_constants.cpp:31
int ScanGrid(int p_x, int p_y, bool avq)
Definition: Roe_Population_Manager.cpp:280

References FemaleDensityThreshold, Roe_Base::IsAlive(), TAnimal::m_Location_x, TAnimal::m_Location_y, TAnimal::m_OurLandscape, Roe_Base::m_OurPopulation, Roe_Base::m_SearchRange, RoeDeer_Population_Manager::ScanGrid(), and Landscape::Warn().

Referenced by Step().

◆ FOnNewDay()

int Roe_Female::FOnNewDay ( void  )
private

Roe_Female::FOnNewDay - updates age of female object (+ 1 day), decides if life expectancy has been reached, which depends on age (Floaters have a higher mortality (added FloatMort)). Checks whether dispersers and floaters can set up range by checking habitat and closeness to mothers range and amount of males already in the area. If failed to find a range before october 1st become a floater. Also governs whether to dissolve or stay in female group - dissolvement dependent on date. If dissolved group, sends female back to old range. Returns values to set the following states: establish range, Form group, update energy (and die). Calls functions DistanceTo(), ScanGrid(), SupplyFemaleRC(), RemoveFromGroup().

752 {
753  #ifdef JUJ__Debug3
754  if(IsAlive()!=0x0DEADC0DE)
755  {
756  m_OurLandscape ->Warn("Roe_Female::FOnNewDay(): Deadcode warning","");
757  exit( 1 );
758  }
759  #endif
760  m_Age++; //1 day older
761  m_DestinationDecided=false; //don't know yet whereto after this
762  m_NewState=0;
763  //First decide if life expectancy has been reached. Depends on age. Floaters
764  //have a higher mortality than other (added FloatMort)
765  int mort;
766  int dist;
767  long int die=random(100000); //since mort rates are multiplied with 100000 to
768  //produce int values
769  if (m_Age<=730)
770  mort=(int)FemaleDMR[0]; //age in days
771  else if (m_Age<=2555) //7 yrs
772  mort=(int)FemaleDMR[1];
773  else if (m_Age<=3650) //10 yrs
774  mort=(int)FemaleDMR[2];
775  else mort =(int)FemaleDMR[3]; //>10 yrs
776 
777  if((m_float)||(m_Disperse)) mort+=FloatMort;
778 
779  if (die<mort)
780  {
781  return 41; //Die
782  }
783  else //still alive
784  {
785  //RANGES
786  if (m_Disperse) //disperser that needs a range
787  {
788  if(!m_float)
789  {
790  //dispersers check dist back to mothers RangeCentre
792  }
793  else
794  { //floaters check dist back to last attempt to set up range
796  }
797  if(dist>MinDispDistance)
798  {
799  //both floaters and regular dispersers go in here
800  bool found = false;
802  if(range > 0) //OK
803  {
804  //how many other females have already their range in this area?
805  ListOfFemales* females = m_OurPopulation->
806  SupplyFemaleRC(m_Location_x,m_Location_y,range);
807 
808  if(females->size() < FemaleDensityThreshold) //OK
809  {
810  //OK to settle here, so return to EstablishRange after this
811  found=true;
812  m_SearchRange=range;
814  m_NewState=7; //establishrange
815  }
816  delete females;
817  }
818  if (!found) //quality too poor or still too close to mother, so return to disperse
819  {
820  //if failed to find a range before Sept. 1st become a floater
821  if(m_OurLandscape->SupplyDayInYear() >= 242)
822  { //floaters store present location for use in next attempt to set up range
823  m_float=true;
826  //remove this deer from its group
828  m_MyGroup=-1;
829  }
830  m_NewState=10; //disperse
832  }
833  }
834  }
835 
836  //GROUPS
837  if(!m_float)
838  {
839  //get day
840  int day=m_OurLandscape->SupplyDayInYear();
841  if ((day==120)&&(m_GroupUpdated==true)) //time to dissolve groups
842  {
843  Send_EndGroup();
844  m_GroupUpdated=false;
845  ListOfFemales* females = m_OurPopulation->
846  SupplyFemaleRC(m_OldRange_x, m_OldRange_y,m_SearchRange);
847  delete females;
848  m_RangeCentre_x=m_OldRange_x; //go back to old rangecentre
850  }
851  if ((day == 274)&&(m_GroupUpdated == false)) //after Oct. 1st and still not in group
852  {
853  return 15; //FormGroup
854  }
855  }
856  }
857  return 4; //update energy
858 }
const float FemaleDMR[4]
Definition: Roe_constants.cpp:134
const int MinDispDistance
Definition: Roe_constants.cpp:24
const int FloatMort
Definition: Roe_constants.cpp:133
int SupplyDayInYear(void)
Definition: landscape.h:1596
int m_float_x
Definition: Roe_all.h:240
int m_NewState
Definition: Roe_all.h:238
bool m_DestinationDecided
Definition: Roe_all.h:237
int m_float_y
Definition: Roe_all.h:241
void Send_EndGroup()
Definition: Roe_female.cpp:2064

References Roe_Base::DistanceTo(), FemaleDensityThreshold, FemaleDMR, FloatMort, Roe_Base::IsAlive(), Roe_Base::m_Age, Roe_Adult_Base::m_DestinationDecided, Roe_Base::m_Disperse, Roe_Base::m_float, Roe_Adult_Base::m_float_x, Roe_Adult_Base::m_float_y, m_GroupUpdated, TAnimal::m_Location_x, TAnimal::m_Location_y, m_MyGroup, Roe_Adult_Base::m_NewState, Roe_Base::m_OldRange_x, Roe_Base::m_OldRange_y, TAnimal::m_OurLandscape, Roe_Base::m_OurPopulation, Roe_Base::m_RangeCentre_x, Roe_Base::m_RangeCentre_y, Roe_Base::m_SearchRange, MinDispDistance, random(), RoeDeer_Population_Manager::RemoveFromGroup(), RoeDeer_Population_Manager::ScanGrid(), Send_EndGroup(), Landscape::SupplyDayInYear(), and Landscape::Warn().

Referenced by Step().

◆ FRecover()

int Roe_Female::FRecover ( void  )
private

Roe_Female::FRecover - Governs recovery after running from danger. Function counts amount of time in state during the present period of recovovery (m_RecovCount) and sets this to 0 when state is left. Female only transfers to this state if safe, whichs means in good habitat. Returns states: feeding, recovery.

473 {
474  #ifdef JUJ__Debug3
475  if(IsAlive()!=0x0DEADC0DE)
476  {
477  m_OurLandscape ->Warn("Roe_Female::FRecover(): Deadcode warning","");
478  exit( 1 );
479  }
480  #endif
481  //Need to count amount of time in state during the present
482  //period of recov. (m_RecovCount) and set this to 0 when state is left.
483  //Roe only transfers to this state if safe (i.e. cover>=3) so we know it is in
484  //good habitat
485  m_MinInState[5]+=1; //add 1 to time spend in this state
486 
487  //allow roe the opportunity to return to this state after disturbance
488  m_LastState=22;
490  {
491  m_RecovCount++; //add 1 to time spend in recover and stay here
492  return 22; //recover
493  }
495  //return to feed with certain probability
496  {
497  int stop= random(100);
498  if (stop<10)
499  {
500  m_RecovCount=0; //leaves state, so set counter=0
501  m_FeedCount=0; //ruminating also takes place during recovery, so start
502  //from scratch in Feed
503  return 35;
504  }
505  else
506  {
507  m_RecovCount++; //add 1 to time spend in this state
508  return 22;
509  }
510  }
511  else //if still around after this long return to feeding
512  {
513  m_RecovCount=0;
514  return 35;
515  }
516 }
const int MaxRecoveryTime
Definition: Roe_constants.cpp:39
const int AverageRecoveryTime
Definition: Roe_constants.cpp:38
int m_RecovCount
Definition: Roe_all.h:133

References AverageRecoveryTime, Roe_Base::IsAlive(), Roe_Base::m_FeedCount, Roe_Base::m_LastState, m_MinInState, TAnimal::m_OurLandscape, Roe_Base::m_RecovCount, MaxRecoveryTime, random(), and Landscape::Warn().

Referenced by Step().

◆ FRuminate()

int Roe_Female::FRuminate ( void  )
private

Roe_Female::FRuminate - Function for ruminating. Checks for got spot to rest and amount of time spent ruminating. Ruminate activity cannot be seperated from other kinds of inactivity. It is also assumed that ruminating takes place while recovering after disturbance. Need to count amount of time spend in this state during this period of ruminating and in total last 24 hrs. Returns values for either stay ruminating, feed or dispersal (or die).Calls function Cover().

568 {
569  #ifdef JUJ__Debug3
570  if(IsAlive()!=0x0DEADC0DE)
571  {
572  m_OurLandscape ->Warn("Roe_Female::FRuminate(): Deadcode warning","");
573  exit( 1 );
574  }
575  #endif
576  //ruminate activity cannot be seperated from other kinds of inactivity.
577  //It is also assumed that ruminating takes place while recovering after
578  //disturbance. Need to count amount of time spend in this state during
579  //this period of ruminating and in total last 24 hrs
580  m_MinInState[8]+=1; //add 1 to time spend in this state
581  int min;
582  //First check if this is first timestep in this state
583  //allow roe the opportunity to return to this state after disturbance
584  m_LastState=32;
585  if (m_RumiCount==0) //first step so make sure this is a good spot to rest
586  {
587  int cover=Cover(m_Location_x,m_Location_y);
588  //get month
589  int month=m_OurLandscape->SupplyMonth();
590  if((month>=5)&&(month<=9)) min=CoverThreshold2; //summer
591  else min=CoverThreshold1; //winter
592  if (cover<min)// habitat unsuitable or cover very poor, so look for better spot
593  {
594  SeekCover(2);
595  if(m_IsDead) return 41; //Die
596  else
597  {
598  m_RumiCount++;
599  return 32;
600  }
601  }
602  else //cover OK
603  {
604  m_RumiCount++; //add 1 to counter
605  return 32; //return to this state next time step
606  }
607  }
609  {
610  m_RumiCount++; //add 1 to counter
611  return 32; //stay
612  }
613  else
614  {
615  if(m_Disperse==true) return 10;
616  else //not disperser
617  {
619  {
620  m_RumiCount=0;
621  return 35; //feed
622  }
623  else
624  {
625  int rand=random(100);
626  if(rand<50)
627  {
628  m_RumiCount++;
629  return 32; //stay
630  }
631  else
632  {
633  m_RumiCount=0;
634  return 35;
635  }
636  }
637  }
638  }
639 }
const int CoverThreshold2
Definition: Roe_constants.cpp:41
const int CoverThreshold1
Definition: Roe_constants.cpp:40
void SeekCover(int threshold)
Definition: Roe_base.cpp:42
int Cover(int polyref)
Calls the cover calculation for a given polyref.
Definition: Roe_base.cpp:943
int m_RumiCount
Definition: Roe_all.h:134

References Roe_Base::Cover(), CoverThreshold1, CoverThreshold2, Roe_Base::IsAlive(), Roe_Base::m_Disperse, Roe_Base::m_IsDead, Roe_Base::m_LastState, Roe_Base::m_LengthRuminate, TAnimal::m_Location_x, TAnimal::m_Location_y, m_MinInState, TAnimal::m_OurLandscape, Roe_Base::m_RumiCount, random(), Roe_Base::SeekCover(), Landscape::SupplyMonth(), and Landscape::Warn().

Referenced by Step().

◆ FRun()

int Roe_Female::FRun ( )
private

Roe_Female::FRun - Sets the female object to be in a running state - and checks if safe after 1 time step in this state. Calls Running().

442 {
443  #ifdef JUJ__Debug3
444  if(IsAlive()!=0x0DEADC0DE)
445  {
446  m_OurLandscape ->Warn("Roe_Female::FRun(): Deadcode warning","");
447  exit( 1 );
448  }
449  #endif
450  m_MinInState[4]+=1; //add 1 to time spend in this state
451 
452  bool IsSafe=Running(m_danger_x,m_danger_y);
453  if(m_IsDead) return 41; //Die
454  else if (!IsSafe) //still not safe after 1 time step
455  {
456  return 19; //Run
457  }
458  else
459  {
460  m_RecovCount++; //add 1 to time spend in recovery
461  return 22; //recover
462  }
463 }
bool Running(int x, int y)
Definition: Roe_base.cpp:380

References Roe_Base::IsAlive(), Roe_Base::m_danger_x, Roe_Base::m_danger_y, Roe_Base::m_IsDead, m_MinInState, TAnimal::m_OurLandscape, Roe_Base::m_RecovCount, Roe_Base::Running(), and Landscape::Warn().

Referenced by Step().

◆ FUpdateEnergy()

int Roe_Female::FUpdateEnergy ( void  )
private

Roe_Female::FUpdateEnergy - Calculates how much energy is used (in cal/minute) in different activities. Calculates net energy (gained-used) and determines whether excess enery is added to reserves or is used to put on weight. A negative net energy causes the female object to loose weight - if roe deer weight falls below a minimum value, the deer will die. If the roe deer is in very bad condition, the female may abandon fawns and increase forage time. returns states such as feed, update gestation or die.

870 {
871  #ifdef JUJ__Debug3
872  if(IsAlive()!=0x0DEADC0DE)
873  {
874  m_OurLandscape ->Warn("Roe_Female::FUpdateEnergy(): Deadcode warning","");
875  exit( 1 );
876  }
877  #endif
878  //All energetic calculations in cal/timestep
879  //find resting metabolic rate
880  float RMR=FemaleRMR[0];
881  float EnergyUsed=0;
882  int month=m_OurLandscape->SupplyMonth();
883  //FemaleRMR depends on reproductive state, so find out if pregnant
884  if (m_Pregnant==true)
885  {
886  if (m_Gestationdays >=240) RMR=FemaleRMR[1]; //late pregnancy
887  }
888  else if ((m_DaysSinceParturition > 0)&&(m_DaysSinceParturition <= 120)) //young fawn
889  {
890  if (m_DaysSinceParturition <=15) RMR=FemaleRMR[2];
891  else if (m_DaysSinceParturition <=30) RMR=FemaleRMR[3];
892  else if (m_DaysSinceParturition <=60) RMR=FemaleRMR[4];
893  else if (m_DaysSinceParturition <=90) RMR=FemaleRMR[5];
894  else RMR=FemaleRMR[6];
895  }
896  if(RMR!=FemaleRMR[0]) //in a period of elevated RMR, so add the difference
897  {
898  EnergyUsed += 144 * (RMR-FemaleRMR[0]) * (m_Size*0.001f); // 144?? where does this come from - ljk 02/08-2012
899  }
900  //Calculate how much energy used in different activities
901  for (int i=0; i<12; i++)
902  {
903  float cost;
904  if (CostFemaleAct[i]==1) cost=CostFemaleAct[i]*RMR;
905  else cost= (float) CostFemaleAct[i];
906  EnergyUsed += (cost * m_MinInState[i] * (m_Size*0.001f));
907  }
908  double result = m_EnergyGained - EnergyUsed; //in cal
909  if (result>0)
910  {
911  if (m_Reserves < 10) m_Reserves++;
912  else
913  {
914  m_Size += (int)floor (result*Anabolic_Inv); //put on weight
915  }
916  }
917  else if (result<0)
918  {
919  if (m_Reserves>0) m_Reserves--; //subtract 1 from reserves
920  else
921  {
922  m_Size += (int)floor(result*Catabolic_Inv); //loose weight
923  }
924  }
925  //Update m_Size. If m_Size is approaching a critical value, roe gives up its
926  //range and starts dispersing. Fawns younger than 2 months dies.
927  //If m_Size < MinSize roe dies
928 
929  if ((m_Reserves==0)&&(m_Pregnant==false))
930  {
931  if(m_Size < m_OurPopulation->m_MinWeight_Females)
932  {
933  return 41; //Die
934  }
935  else if(m_Size<m_OurPopulation->m_CriticalWeight_Females)
936  { // in very bad condition, abandon fawns and increase foraging time
937  if(m_NoOfYoung>0)
938  {
939  for(unsigned i=0;i<20;i++)
940  {
941  if ((m_MyYoung[i]!=NULL)&&(m_MyYoung[i]->m_Age<=365))
942  {
943  m_MyYoung[i]->On_MumAbandon(this); //abandon the fawns
944  m_MyYoung[i]=NULL;
945  m_NoOfYoung--;
946  }
947  }
948  }
949  m_LengthFeedPeriod = (int)((5*m_Size*0.001)/
950  Female_FeedBouts[month-1]);
952  m_NewState=35; //go to feed after this
953  }
954  else //everything OK
955  {
956  m_LengthFeedPeriod = (int)((3*m_Size*0.001)/
957  Female_FeedBouts[month-1]);
959  }
960  }
961  //set counter of daily energy gain and MinInState to zero
962  m_EnergyGained=0;
963  for(int i=0;i<12;i++)
964  {
965  m_MinInState[i]=0;
966  }
967  return 3; //Update gestation
968 }
const int CostFemaleAct[12]
Definition: Roe_constants.cpp:106
const float Catabolic_Inv
Definition: Roe_constants.cpp:123
const float Anabolic_Inv
Definition: Roe_constants.cpp:120
const float FemaleRMR[7]
Definition: Roe_constants.cpp:74
const int Female_FeedBouts[12]
Definition: Roe_constants.cpp:91
virtual void On_MumAbandon(Roe_Female *)
Definition: Roe_all.h:216

References Anabolic_Inv, Catabolic_Inv, CostFemaleAct, Female_FeedBouts, FemaleRMR, Roe_Base::IsAlive(), Roe_Base::m_Age, m_DaysSinceParturition, Roe_Adult_Base::m_DestinationDecided, Roe_Base::m_EnergyGained, m_Gestationdays, Roe_Base::m_LengthFeedPeriod, m_MinInState, m_MyYoung, Roe_Adult_Base::m_NewState, m_NoOfYoung, TAnimal::m_OurLandscape, m_Pregnant, Roe_Base::m_Reserves, Roe_Base::m_Size, Roe_Base::On_MumAbandon(), Landscape::SupplyMonth(), and Landscape::Warn().

Referenced by Step().

◆ FUpdateGestation()

int Roe_Female::FUpdateGestation ( void  )
private

Roe_Female::FUpdateGestation - Checks if it is time to give birth if pregnant. Controls taking care of young, mating, the probability of going into heat (dependent on age and time of year). Returns states giveBirth, inHeat, CareFOrYoung or mate.

1050 {
1051  #ifdef JUJ__Debug3
1052  if(IsAlive()!=0x0DEADC0DE)
1053  {
1054  m_OurLandscape ->Warn("Roe_Female::FUpdateGestation(): Deadcode warning","");
1055  exit( 1 );
1056  }
1057  #endif
1058  int day = m_OurLandscape->SupplyDayInYear();
1059  if(day==0) m_WasInHeat=false; //new season
1060  if (m_Pregnant==true)
1061  {
1062  if ((m_Gestationdays == GestationPeriod))
1063  {
1064  m_DestinationDecided=true;
1065  m_NewState=18; //CareForYoung
1066  return 17; //GiveBirth
1067  }
1068  else m_Gestationdays++;
1069  }
1070  else //not pregnant
1071  {
1072  if (m_My_Mate!=NULL)
1073  {
1074  #ifdef JUJ__Debug3
1075  if(m_My_Mate->IsAlive()!=0x0DEADC0DE)
1076  {
1077  m_OurLandscape ->Warn("Roe_Female::FUpdateGestation():Deadcode warning. m_My_Mate","");
1078  exit( 1 );
1079  }
1080  #endif
1081  m_DestinationDecided=true;
1082  return 39; //Mate
1083  }
1084 
1085  else if (m_DaysSinceParturition >= 0) //with young fawn
1086  {
1088  else m_DaysSinceParturition=-1; //no need to count anymore
1089  }
1090  else //not mated and not with fawn
1091  {
1092  if ((m_WasInHeat==false)&&(m_HaveRange==true)&&(day >= 230)
1093  && (day <= 250)
1094  && (m_Age <= 730))
1095  {
1096  int YearlHeat;
1097  YearlHeat=random(100);
1098 
1099  if (YearlHeat<20) //20, small probability each day, 60 % ends up being mated
1100  { //can go in heat
1101  m_DestinationDecided=true;
1102  m_NewState=16; //start next day in InHeat
1103  m_WasInHeat=true; //only 1 heat period per season
1104  }
1105  }
1106  else if ((m_WasInHeat==false)&&(m_HaveRange==true)&&(day >= 230)
1107  && (day <= 250)
1108  && (m_Age > 730))
1109  { //can go in heat
1110  int AdultHeat;
1111  AdultHeat=random(100);
1112  if (AdultHeat<30) //30, slightly larger prob., 85 % ends up being mated
1113  {
1114  m_DestinationDecided=true;
1115  m_NewState=16; //start next day in InHeat
1116  m_WasInHeat=true;
1117  }
1118  }
1119  }
1120  }
1121  //if roe is not going to mate or givebirth we need to assure that a new
1122  //destination has been set
1123  if (m_DestinationDecided==true)
1124  {
1125  return m_NewState;
1126  }
1127  else //no destination decided, so go back to same state as before OnNewDay
1128  {
1129  return m_LastState;
1130  }
1131 }
const int GestationPeriod
Definition: Roe_constants.cpp:154

References GestationPeriod, Roe_Base::IsAlive(), Roe_Base::m_Age, m_DaysSinceParturition, Roe_Adult_Base::m_DestinationDecided, m_Gestationdays, Roe_Base::m_HaveRange, Roe_Base::m_LastState, m_My_Mate, Roe_Adult_Base::m_NewState, TAnimal::m_OurLandscape, m_Pregnant, m_WasInHeat, random(), Landscape::SupplyDayInYear(), and Landscape::Warn().

Referenced by Step().

◆ Init()

void Roe_Female::Init ( void  )

◆ On_ApproachOfDanger()

void Roe_Female::On_ApproachOfDanger ( int  p_To_x,
int  p_To_y 
)
protected

Roe_Female::On_ApproachOfDanger - Determines whether to run or evade a threat depending on cover and distance to threath. In good cover, female will run if threath is less than 30 m away and else perform evasive behavior, In intermediate cover the flight distance is 50 m, and in poor cover it is 70 m. Returns states evade or run. Calls Cover(), DistanceTo().

1994 {
1995  m_danger_x=p_To_x;
1996  m_danger_y=p_To_y;
1997  //get cover
1998  int cov=Cover(m_Location_x,m_Location_y);
1999  //get distance to threat
2000  int dist=DistanceTo(m_Location_x, m_Location_y,p_To_x,p_To_y);
2001 
2002  if (cov >= CoverThreshold2) //good cover
2003  {
2004  if(dist >= 30)
2005  {
2007  }
2008  else CurrentRState=rds_FRun;
2009  }
2010  else if (cov >= CoverThreshold1) //intermediate cover
2011  {
2012  if(dist>=50)
2013  {
2015  }
2016  else CurrentRState=rds_FRun;
2017  }
2018  else //poor cover
2019  {
2020  if(dist>=70)
2021  {
2023  }
2024  else CurrentRState=rds_FRun;
2025  }
2026 }
@ rds_FEvade
Definition: Roe_all.h:73
@ rds_FRun
Definition: Roe_all.h:65

References Roe_Base::Cover(), CoverThreshold1, CoverThreshold2, Roe_Base::CurrentRState, Roe_Base::DistanceTo(), Roe_Base::m_danger_x, Roe_Base::m_danger_y, TAnimal::m_Location_x, TAnimal::m_Location_y, rds_FEvade, and rds_FRun.

◆ On_CanJoinGroup()

int Roe_Female::On_CanJoinGroup ( Roe_Female Female)
protected

Roe_Female::On_CanJoinGroup - Called by female object, and evaluates whether a new female (found by searching for all females withing a range of the calling females location) can join a female group or not. Returns an int >0 if new roe can join group, returns 0 if roe cannot join. First makes sure that new female is not a floater, since floaters cannot have a group. Then looks at new females current group size and whether or not the new female is the calling female's mother. If so, function returns group size. If new female does not have group function returns 1. If new female has group, function checks if this group size is less than optimal group size andd returns group size if so and 0 otherwise (cannot have larger group than optimum group size) Calls Supply_GroupSize()

2110 {
2111  //returns an int >0 if new roe can join group, Returns 0 if roe cannot join
2112  int answer=0;
2113  if(!m_float) //floaters don't have a group
2114  {
2115  size_t Group_Size=m_OurPopulation->Supply_GroupSize(m_MyGroup);
2116  //if sender is offspring
2117  for (int i=0; i<10; i++)
2118  {
2119  if (m_MyYoung[i]==Female) //is on list
2120  {
2121  answer=(int)Group_Size;
2122  }
2123  }
2124 
2125  if (m_HaveGroup==false) answer=1;
2126  else
2127  {
2128  if (Group_Size < m_OptGroupSize) answer=(int)Group_Size;
2129  else answer=0; //don't want a larger group
2130  }
2131  }
2132  return answer;
2133 }

References Roe_Base::m_float, m_HaveGroup, m_MyGroup, m_MyYoung, m_OptGroupSize, Roe_Base::m_OurPopulation, and RoeDeer_Population_Manager::Supply_GroupSize().

◆ On_EndCare()

void Roe_Female::On_EndCare ( Roe_Fawn Fawn)

Roe_Female::On_EndCare - Fawn ends it's care period - returns false.

2053 {
2054  m_Care=false;
2056 }
@ rds_FFeed
Definition: Roe_all.h:81

References Roe_Base::CurrentRState, m_Care, and rds_FFeed.

Referenced by Roe_Fawn::FASuckle().

◆ On_EndGroup()

void Roe_Female::On_EndGroup ( )
protectedvirtual

Roe_Female::On_EndGroup - after group is dissolved this function sets range centers to old individual centers.

Reimplemented from Roe_Base.

2141 {
2142  m_RangeCentre_x=m_OldRange_x; //go back to own range
2144  m_GroupUpdated=false; //group not "active" anymore
2145 }

References m_GroupUpdated, Roe_Base::m_OldRange_x, Roe_Base::m_OldRange_y, Roe_Base::m_RangeCentre_x, and Roe_Base::m_RangeCentre_y.

◆ On_InitCare()

bool Roe_Female::On_InitCare ( Roe_Fawn Fawn)

Roe_Female::On_InitCare - Returns true if female objects allows fawn to feed (if her reserves are > 0) otherwise it returns false.

2034 {
2035  //mother will feed fawns if her reserves are > 0
2037  {
2038  m_Care=true;
2040  }
2041  else
2042  {
2044  m_Care=false;
2045  }
2046  return m_Care;
2047 }
@ rds_FCareForYoung
Definition: Roe_all.h:64
int m_CriticalWeight_Females
Definition: Roe_all.h:511

References Roe_Base::CurrentRState, m_Care, RoeDeer_Population_Manager::m_CriticalWeight_Females, Roe_Base::m_OurPopulation, Roe_Base::m_Size, rds_FCareForYoung, and rds_FFeed.

Referenced by Roe_Fawn::FAFeed(), Roe_Fawn::FAHide(), Roe_Fawn::FARecover(), Roe_Fawn::FASuckle(), and Roe_Fawn::Send_InitCare().

◆ On_IsDead()

void Roe_Female::On_IsDead ( Roe_Base Someone,
int  whos_dead,
bool  fawn 
)
virtual

Roe_Female::On_IsDead - governs a female objects "response" to death of another object. Checks who is dead (mom, female, mate) and sets them to NULL. If mother is dead, the "responding" female object deletes pointer to mom. If mate is dead, the female will go back into heat. If offspring is dead (both fawns and adults), they will be removed from offspring list.

Reimplemented from Roe_Base.

1926 {
1927  #ifdef JUJ__Debug3
1928  if(IsAlive()!=0x0DEADC0DE)
1929  {
1930  m_OurLandscape ->Warn("Roe_Female::On_IsDead(): Deadcode warning!","");
1931  exit( 1 );
1932  }
1933  #endif
1934  //If whos_dead is mother
1935  switch (whos_dead)
1936  {
1937  case 0: //mother
1938  {
1939  if(Someone==Mum) Mum=NULL; //delete pointer to mother
1940  }
1941  break;
1942  case 2: //attending male
1943  {
1944  if(m_My_Mate==dynamic_cast<Roe_Male*> (Someone))
1945  {
1946  m_My_Mate=NULL; //remove pointer to male
1948  }
1949  }
1950  break;
1951  case 3: //offspring, both fawns and adult offspring
1952  {
1953  for (int i=0; i<21; i++)
1954  {
1955  if((m_MyYoung[i]!=NULL)&&(m_MyYoung[i]==Someone))
1956  {
1957  if(m_MyYoung[i]->IsAlive()!= 0x0DEADC0DE)
1958  {
1959  m_OurLandscape ->Warn("Roe_Female::On_IsDead():Deadcode warning, m_MyYoung[i]!","");
1960  exit( 1 );
1961  }
1962  m_MyYoung[i]=NULL;
1963  break;
1964  }
1965  if (i==20)
1966  {
1967  m_OurLandscape ->Warn("Roe_Female::On_IsDead():Variable out of range, m_MyYoung!","");
1968  exit( 1 );
1969  }
1970  }
1971  //subtract 1 from NoOfYoung if Someone is a fawn from this year;
1972  if (fawn==true)
1973  {
1974  m_NoOfYoung--;
1975  }
1976  }
1977  break;
1978  }
1979 }
@ rds_FInHeat
Definition: Roe_all.h:62
Definition: Roe_all.h:380

References Roe_Base::CurrentRState, Roe_Base::IsAlive(), m_My_Mate, m_MyYoung, m_NoOfYoung, TAnimal::m_OurLandscape, Roe_Base::Mum, rds_FInHeat, and Landscape::Warn().

Referenced by Roe_Fawn::FADie(), FDie(), and Roe_Male::MDie().

◆ On_UpdateGroup()

void Roe_Female::On_UpdateGroup ( int  p_group_x,
int  p_group_y 
)
protectedvirtual

Roe_Female::On_UpdateGroup - updates group status by changing range center to that of group while storing old range center for when ghroup is dissolved and roe needs to go back to own range.

Reimplemented from Roe_Base.

2089 {
2090  m_GroupUpdated=true;
2091  m_OldRange_x=m_RangeCentre_x; //stores own rangecentre while in group range
2093  m_RangeCentre_x=p_group_x; //consider this as your rangecentre while in group
2094  m_RangeCentre_y=p_group_y;
2095 }

References m_GroupUpdated, Roe_Base::m_OldRange_x, Roe_Base::m_OldRange_y, Roe_Base::m_RangeCentre_x, and Roe_Base::m_RangeCentre_y.

◆ Send_EndGroup()

void Roe_Female::Send_EndGroup ( )
protected

Roe_Female::Send_EndGroup - calls to dissolve female group. Calls Supply_RoeGroup(), On_EndGroup()

2065 {
2067  for (unsigned i=0; i<MyGroup->size(); i++)
2068  {
2069  #ifdef JUJ__Debug3
2070  if((*MyGroup)[i]->IsAlive()!=0x0DEADC0DE)
2071  {
2072  m_OurLandscape ->Warn("Roe_Female::Send_EndGroup():Deadcode warning, m_MyGroup[i]!","");
2073  exit( 1 );
2074  }
2075  #endif
2076  if((*MyGroup)[i]!=this)
2077  {
2078  (*MyGroup)[i]->On_EndGroup();
2079  }
2080  }
2081 }

References Roe_Base::IsAlive(), m_MyGroup, TAnimal::m_OurLandscape, Roe_Base::m_OurPopulation, RoeDeer_Population_Manager::Supply_RoeGroup(), and Landscape::Warn().

Referenced by FOnNewDay().

◆ Step()

void Roe_Female::Step ( void  )
virtual

Roe_Female::Step - function called every time step. The functions checks if done with a given state (m_StepDone) and governs states and transitions to other states. Calls functions: FOnMature(), FDie(), FOnNewDay(), FUpdateGestation(),FMate(), FFormGroup(), FGiveBirth(), FEstablishRange(), FDisperse(), FFeed(), FRecover(), FRUn(), FEvade(), FIgnore(), FRuminate, FCareForYoung(), FUpdateEnergy(), FInHeat().

Reimplemented from Roe_Adult_Base.

1411 {
1412  #ifdef JUJ__Debug3
1413  if(IsAlive()!=0x0DEADC0DE)
1414  {
1415  m_OurLandscape ->Warn("Roe_Female::Step(): Deadcode warning","");
1416  exit( 1 );
1417  }
1418  #endif
1419 
1420 
1421  if (m_StepDone || (CurrentRState==rds_FDeathState)) return;
1422 
1423  switch (CurrentRState)
1424  {
1425  case rds_Initialise:
1427  break;
1428  case rds_FOnMature:
1429  switch (FOnMature())
1430  {
1431  case 7: //rds_FEstablishRange:
1433  break;
1434  case 10: //rds_FDisperse:
1436  break;
1437  default:
1438  m_OurLandscape ->Warn("Roe_Female::Step(): rds_FOnMature: No matching case!","");
1439  exit( 1 );
1440  break;
1441  }
1442  m_StepDone=true;
1443  break;
1444  case rds_FDie:
1445  switch (FDie())
1446  {
1447  case 44:
1449  m_StepDone=true;
1450  break;
1451  default:
1452  m_OurLandscape ->Warn("Roe_Female::Step(): rds_FDie: No matching case!","");
1453  exit( 1 );
1454  break;
1455  }
1456  break;
1457 
1458  case rds_FOnNewDay:
1459  switch (FOnNewDay())
1460  {
1461  case 4: //rds_FUpdateEnergy:
1463  break;
1464  case 15: //rds_FormGroup
1466  break;
1467  case 41: //rds_FDie:
1469  break;
1470  default:
1471  m_OurLandscape ->Warn("Roe_Female::Step(): rds_FOnNewDay: No matching case!","");
1472  exit( 1 );
1473  break;
1474  }
1475  break;
1476  case rds_FUpdateGestation:
1477  switch (FUpdateGestation())
1478  {
1479  case 7: //rds_FEstablishRange
1481  m_StepDone=true;
1482  break;
1483  case 10: // rds_FDisperse
1485  m_StepDone=true;
1486  break;
1487  case 16: //rds_FInHeat:
1489  m_StepDone=true;
1490  break;
1491  case 17: //rds_FGiveBirth:
1493  break;
1494  case 18: //rds_FCareForYoung
1496  m_StepDone=true;
1497  break;
1498  case 22: //rds_FRecover:
1500  m_StepDone=true;
1501  break;
1502  case 32: //rds_FRuminate
1504  m_StepDone=true;
1505  break;
1506  case 35: //rds_FFeed
1508  m_StepDone=true;
1509  break;
1510  case 39: //rds_FMate:
1512  break;
1513  default:
1514  m_OurLandscape ->Warn("Roe_Female::Step():rds_FUpdategestation: No matching case!","");
1515  exit( 1 );
1516  break;
1517  }
1518  break;
1519  case rds_FMate:
1520  switch(FMate())
1521  {
1522  case 10: // rds_FDisperse
1524  break;
1525  case 16: //rds_FInHeat:
1527  break;
1528  case 18: //rds_FCareForYoung
1530  break;
1531  case 22: //rds_FRecover:
1533  break;
1534  case 32: //rds_FRuminate
1536  break;
1537  case 35: //rds_FFeed
1539  break;
1540  default:
1541  m_OurLandscape ->Warn("Roe_Female::Step(): rds_FMate: No matching case!","");
1542  exit( 1 );
1543  break;
1544  }
1545  m_StepDone=true;
1546  break;
1547  case rds_FFormGroup:
1548  switch (FFormGroup())
1549  {
1550  case 4: //rds_FUpdateEnergy:
1552  break;
1553  default:
1554  m_OurLandscape ->Warn("Roe_Female::Step(): rds_FFormGroup: No matching case!","");
1555  exit( 1 );
1556  break;
1557  }
1558  break;
1559  case rds_FGiveBirth:
1560  switch (FGiveBirth())
1561  {
1562  case 18:
1564  m_StepDone=true;
1565  break;
1566  default:
1567  m_OurLandscape ->Warn("Roe_Female::Step(): rds_FGiveBirth: No matching case!","");
1568  exit( 1 );
1569  break;
1570  }
1571  break;
1572  case rds_FEstablishRange:
1573  switch (FEstablishRange())
1574  {
1575  case 35: //rds_FFeed:
1577  break;
1578  default:
1579  m_OurLandscape ->Warn("Roe_Female::Step():rds_FEstablishRange: No matching case!","");
1580  exit( 1 );
1581  break;
1582  }
1583  m_StepDone=true;
1584  break;
1585  case rds_FDisperse:
1586  switch (FDisperse())
1587  {
1588  case 35: //rds_FFeed:
1590  m_StepDone=true;
1591  break;
1592  case 7: //rds_FEstablishRange:
1594  m_StepDone=true;
1595  break;
1596  case 10: //disperse
1598  m_StepDone=true;
1599  break;
1600  case 41:
1602  break;
1603  default:
1604  m_OurLandscape ->Warn("Roe_Female::Step(): rds_FDisperse: No matching case!","");
1605  exit( 1 );
1606  break;
1607  }
1608  break;
1609  case rds_FFeed:
1610  switch (FFeed())
1611  {
1612  case 10: //rds_FDisperse:
1614  break;
1615  case 32: //rds_FRuminate:
1617  break;
1618  case 35: //rds_FFeed:
1620  break;
1621  case 41: //rds_FDie
1623  break;
1624  default:
1625  m_OurLandscape ->Warn("Roe_Female::Step(): rds_FFeed: No matching case!","");
1626  exit( 1 );
1627  break;
1628  }
1629  m_StepDone=true;
1630  break;
1631  case rds_FRecover:
1632  switch(FRecover())
1633  {
1634  case 35: //rds_FFeed:
1636  break;
1637  case 22: //rds_FRecover
1639  break;
1640  default:
1641  m_OurLandscape ->Warn("Roe_Female::Step(): rds_FRecover: No matching case!","");
1642  exit( 1 );
1643  break;
1644  }
1645  m_StepDone=true;
1646  break;
1647  case rds_FRun:
1648  switch(FRun())
1649  {
1650  case 22: //rds_FRecover:
1652  break;
1653  case 19: //rds_FRun
1655  break;
1656  default:
1657  m_OurLandscape ->Warn("Roe_Female::Step(): rds_FRun: No matching case!","");
1658  exit( 1 );
1659  break;
1660  }
1661  m_StepDone=true;
1662  break;
1663  case rds_FEvade:
1664  switch(FEvade())
1665  {
1666  case 10:
1668  break;
1669  case 16:
1671  break;
1672  case 18:
1674  break;
1675  case 22:
1677  break;
1678  case 32:
1680  break;
1681  case 35:
1683  break;
1684  default:
1685  m_OurLandscape ->Warn("Roe_Female::Step(): rds_FEvade: No matching case!","");
1686  exit( 1 );
1687  }
1688  m_StepDone=true;
1689  break;
1690  case rds_FIgnore:
1691  switch(FIgnore())
1692  {
1693  case 10:
1695  break;
1696  case 16:
1698  break;
1699  case 18:
1701  break;
1702  case 22:
1704  break;
1705  case 32:
1707  break;
1708  case 35:
1710  break;
1711  default:
1712  m_OurLandscape ->Warn("Roe_Female::Step(): rds_FIgnore: No matching case!","");
1713  exit( 1 );
1714  }
1715  m_StepDone=true;
1716  break;
1717  case rds_FRuminate:
1718  switch (FRuminate())
1719  {
1720  case 10:
1722  m_StepDone=true;
1723  break;
1724  case 35:
1726  m_StepDone=true;
1727  break;
1728  case 32:
1730  m_StepDone=true;
1731  break;
1732  case 41:
1734  break;
1735  default:
1736  m_OurLandscape ->Warn("Roe_Female::Step(): rds_FRuminate: No matching case!","");
1737  exit( 1 );
1738  break;
1739  }
1740  break;
1741  case rds_FCareForYoung:
1742  switch (FCareForYoung())
1743  {
1744  case 35: //rds_FFeed:
1746  break;
1747  case 18: //rds_FCareForYoung
1749  break;
1750  default:
1751  m_OurLandscape ->Warn("Roe_Female::Step():rds_FCareForYoung: No matching case!","");
1752  exit( 1 );
1753  break;
1754  }
1755  m_StepDone=true;
1756  break;
1757  case rds_FUpdateEnergy:
1758  switch (FUpdateEnergy())
1759  {
1760  case 41: //rds_FDie:
1762  break;
1763  case 3: //rds_FUpdateGestation:
1765  break;
1766  case 10:
1768  break;
1769  default:
1770  m_OurLandscape ->Warn("Roe_Female::Step(): rds_FUpdateEnergy: No matching case!","");
1771  exit( 1 );
1772  break;
1773  }
1774  break;
1775  case rds_FInHeat:
1776  switch (FInHeat())
1777  {
1778  case 35: //rds_FFeed:
1780  break;
1781  case 16: //rds_FInheat
1783  break;
1784  default:
1785  m_OurLandscape ->Warn("Roe_Female::Step(): rds_FInheat: No matching case!","");
1786  exit( 1 );
1787  break;
1788  }
1789  m_StepDone=true;
1790  break;
1791  default:
1792  m_OurLandscape ->Warn("Roe_Female::Step(): No matching case!","");
1793  exit( 1 );
1794  }
1795 }
@ rds_FRuminate
Definition: Roe_all.h:78
@ rds_FDie
Definition: Roe_all.h:87
@ rds_FMate
Definition: Roe_all.h:85
@ rds_FGiveBirth
Definition: Roe_all.h:63
@ rds_FFormGroup
Definition: Roe_all.h:61
@ rds_FOnMature
Definition: Roe_all.h:47
@ rds_FUpdateGestation
Definition: Roe_all.h:49
@ rds_FEstablishRange
Definition: Roe_all.h:53
@ rds_FDisperse
Definition: Roe_all.h:56
@ rds_Initialise
Definition: Roe_all.h:46
@ rds_FUpdateEnergy
Definition: Roe_all.h:50
@ rds_FRecover
Definition: Roe_all.h:68
@ rds_FIgnore
Definition: Roe_all.h:71
int FCareForYoung(void)
Definition: Roe_female.cpp:647
int FFormGroup(void)
Definition: Roe_female.cpp:1169
int FIgnore()
Definition: Roe_female.cpp:546
int FInHeat(void)
Definition: Roe_female.cpp:676
int FMate(void)
Definition: Roe_female.cpp:1138
int FUpdateEnergy(void)
Definition: Roe_female.cpp:869
int FOnMature(void)
Definition: Roe_female.cpp:32
int FRun()
Definition: Roe_female.cpp:441
int FOnNewDay(void)
Definition: Roe_female.cpp:751
int FDie(void)
Definition: Roe_female.cpp:977
int FFeed(void)
Definition: Roe_female.cpp:374
int FEstablishRange(void)
Definition: Roe_female.cpp:72
int FRecover(void)
Definition: Roe_female.cpp:472
int FDisperse(void)
Definition: Roe_female.cpp:299
int FGiveBirth(void)
Definition: Roe_female.cpp:1306
int FEvade()
Definition: Roe_female.cpp:523
int FUpdateGestation(void)
Definition: Roe_female.cpp:1049
int FRuminate(void)
Definition: Roe_female.cpp:567
bool m_StepDone
Indicates whether the iterative step code is done for this timestep.
Definition: PopulationManager.h:118

References Roe_Base::CurrentRState, FCareForYoung(), FDie(), FDisperse(), FEstablishRange(), FEvade(), FFeed(), FFormGroup(), FGiveBirth(), FIgnore(), FInHeat(), FMate(), FOnMature(), FOnNewDay(), FRecover(), FRuminate(), FRun(), FUpdateEnergy(), FUpdateGestation(), Roe_Base::IsAlive(), TAnimal::m_OurLandscape, TALMaSSObject::m_StepDone, rds_FCareForYoung, rds_FDeathState, rds_FDie, rds_FDisperse, rds_FEstablishRange, rds_FEvade, rds_FFeed, rds_FFormGroup, rds_FGiveBirth, rds_FIgnore, rds_FInHeat, rds_FMate, rds_FOnMature, rds_FOnNewDay, rds_FRecover, rds_FRuminate, rds_FRun, rds_FUpdateEnergy, rds_FUpdateGestation, rds_Initialise, and Landscape::Warn().

◆ SupplyGroupNo()

int Roe_Female::SupplyGroupNo ( )
inline
371 {return m_MyGroup;}

◆ SupplyIsPregnant()

int Roe_Female::SupplyIsPregnant ( )
inline
316 {if (m_Pregnant) return 1; else return 0;}

◆ SupplyYoung()

int Roe_Female::SupplyYoung ( )
inline
317 {return m_NoOfYoung;}

Member Data Documentation

◆ m_Care

bool Roe_Female::m_Care
protected

◆ m_DaysSinceParturition

int Roe_Female::m_DaysSinceParturition
protected

◆ m_Gestationdays

int Roe_Female::m_Gestationdays
protected

◆ m_GroupList

vector<int>* Roe_Female::m_GroupList
protected

◆ m_GroupUpdated

bool Roe_Female::m_GroupUpdated
protected

◆ m_HaveGroup

bool Roe_Female::m_HaveGroup
protected

Referenced by On_CanJoinGroup(), and Roe_Female().

◆ m_HeatCount

int Roe_Female::m_HeatCount
protected

Referenced by FInHeat(), and Roe_Female().

◆ m_MinInState

◆ m_My_Mate

Roe_Male* Roe_Female::m_My_Mate
protected

◆ m_MyGroup

◆ m_MyYoung

◆ m_NatalGroup

bool Roe_Female::m_NatalGroup
protected

Referenced by FFormGroup(), and Roe_Female().

◆ m_NoOfYoung

int Roe_Female::m_NoOfYoung
protected

◆ m_OptGroupSize

int Roe_Female::m_OptGroupSize
protected

◆ m_Pregnant

bool Roe_Female::m_Pregnant
protected

◆ m_WantGroup

bool Roe_Female::m_WantGroup
protected

Referenced by FFormGroup().

◆ m_WasInHeat

bool Roe_Female::m_WasInHeat
protected

Referenced by FUpdateGestation(), and Roe_Female().


The documentation for this class was generated from the following files: